GridEh Lookup

Flexible adjustment of a lookup inplace editor

没有输入拼音码搜索功能。

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)

 

Drop-Down Forms

 

 

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;

 

Search panel

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/

 

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;
View Code

  

Data grouping

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  ;

 

DropDown filter list

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

添加Common\ObjectInspectorEh.pas文件,写2行代码就OK,我只能说太方便了。

TRect rect(10, 10, 500, 500);
ShowObjectInspectorForm(curGrid, rect, false);

 

ObjectInspector Form

 

转载于:https://www.cnblogs.com/cb168/p/4314973.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值