Flexible adjustment of a lookup inplace editor
没有输入拼音码搜索功能。
Drop-Down Forms
这个比较符合中国人的习惯,搜索框,不错,点下来箭头才能弹出,能不能输入字母进入搜索。
EhLib allows to create Drop-down Forms that can be shown on pressing of edit button in the text editors.
GridEh的列有这个事件
curGrid->Columns->Items[0]->DropDownFormParams->DropDownForm; __property TCustomForm* DropDownForm ; __property UnicodeString DropDownFormClassName ; __property TDropDownAlign Align ; __property TDropDownPassParamsEh PassParams ; __property UnicodeString PassFieldNames ; __property UnicodeString AssignBackFieldNames ; __property int FormWidth ; __property int FormHeight ; __property bool SaveFormSize ; void __fastcall TFrm::DBGridEh1Columns0OpenDropDownForm(TCustomDBGridEh *Grid, TColumnEh *Column, TEditButtonEh *Button, TCustomForm *&DropDownForm, TDynVarsEh *DynParams)
TDBLookupComboboxEh
Search panel
DBGridEh can display a special panel to search and filter the data in the grid.
curGrid->SearchPanel->FilterOnTyping,以下属性,很好用。
__property bool Enabled ; __property bool PersistentShowing ; __property TShortCut ShortCut; __property TSearchPanelLocationEh; __property bool FilterOnTyping;//输入字母实时过滤 __property bool FilterEnabled;
Data grouping
Grid allows to group data using columns as a criterion of grouping.
It is allowed to display a grid summarizing the records for each group, and the overall record summarizing the bottom of the grid.
需要用到MemTableEh1,DataSetDriverEh1,用普通的adoquery和fdmemtable,clientdataset不能显示。用memtableeh就可以分组了。
DBGridEh2->DataGrouping
__property bool Active ; __property TGridDataGroupLevelsEh* GroupLevels ; __property TGridDataGroupFootersEh* Footers ; __property TGridDataGroupFootersDefValuesEh* FootersDefValues ; __property bool GroupPanelVisible ; __property bool DefaultStateExpanded ; __property TGridDataGroupRowDefValuesEh* GroupRowDefValues ; __property bool ShiftFolldataGroupRow ;
From http://ymg97526.blog.163.com/blog/static/173658160201122695449603/
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
procedure TForm1.FormCreate(Sender: TObject); var i:Integer; begin //DBGridEh1.Flat:=True; DBGridEh1.ColumnDefValues.Title.Alignment:=taCenter; DBGridEh1.DataSource:=DataSource1; DataSource1.DataSet:=MemTableEh1; MemTableEh1.DataDriver:=DataSetDriverEh1; MemTableEh1.CachedUpdates:=True; MemTableEh1.FetchAllOnOpen:=True; //打开获取所有记录 DataSetDriverEh1.ProviderDataSet:=ADOQuery1; ADOQuery1.ConnectionString:='Provider=Microsoft.Jet.OLEDB.4.0;'+ 'Data Source=f:mcmygs.mdb;'+ 'Persist Security Info=False;'+ 'Jet OLEDB:Database Password=123456'; ADOQuery1.Close; ADOQuery1.SQL.Text:='Select cyear,cmonth,fphm,bhsje,se,jshj from zyfp'; ADOQuery1.Open; MemTableEh1.Active:=True; DBGridEh1.DataGrouping.Active:=True; //DBGridEh1.DataGrouping.DefaultStateExpanded:=True; //默认为展开状态 DBGridEh1.DataGrouping.GroupPanelVisible:=True; DBGridEh1.DataGrouping.GroupLevels.Add.Column:=DBGridEh1.Columns[0]; DBGridEh1.DataGrouping.GroupLevels.Add.Column:=DBGridEh1.Columns[1]; //DBGridEh1.Columns[0].Visible:=False; //DBGridEh1.Columns[1].Visible:=False; DBGridEh1.DataGrouping.Font.Style:=[fsBold]; //DBGridEh1.DataGrouping.Color:=clSkyBlue; DBGridEh1.TitleFont.Color:=clBlue; DBGridEh1.GridLineColors.DarkColor:=clRed; //DBGridEh1.GridLineColors.BrightColor:=clBlack; DBGridEh1.ColumnDefValues.Title.Alignment:=taCenter; for i:=0 to MemTableEh1.Fields.Count-1 do begin if MemTableEh1.Fields[i].DataType=ftFloat then DBGridEh1.Columns[i].DisplayFormat:='#,###,###.00'; end; end;
DropDown filter list
Grid allows to filter data using a droped down list box where users can select items for filtering using checkboxes.
DBGridEh2->STFilter->Visible;
还是要用MemTableEh1才起作用。
__property bool InstantApply ; __property bool Local ; __property TSTFilterLocationEh Location ; __property bool Visible ; __property TColor HorzLineColor ; __property int RowHeight ; __property int RowLines ; __property TColor VertLineColor ; __property TDBGridFilterButtonDrawTimeEh FilterButtonDrawTime ;
ObjectInspector Form
Global function to display a ObjectInspector-like Form.
This is a simple ObjectInspector that can be used to debug
property setting at run-time。
TObjectInspectorEh
添加CommonObjectInspectorEh.pas文件,写2行代码就OK,我只能说太方便了。
TRect rect(10, 10, 500, 500); ShowObjectInspectorForm(curGrid, rect, false);