zoukankan      html  css  js  c++  java
  • 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

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

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

    ObjectInspector Form

  • 相关阅读:
    Spring 中出现Element : property Bean definitions can have zero or more properties. Property elements correspond to JavaBean setter methods exposed by the bean classes. Spring supports primitives, refer
    java定时器schedule和scheduleAtFixedRate区别
    hql语句中的select字句和from 字句
    使用maven搭建hibernate的pom文件配置
    Failure to transfer org.apache.maven:maven-archiver:pom:2.5 from http://repo.maven.apache.org/ maven2 was cached in the local repository, resolution will not be reattempted until the update interv
    对于文件File类型中的目录分隔符
    hibernate的事务管理和session对象的详解
    解决mac 中的myeclipse控制台中文乱码问题
    ibatis selectKey用法问题
    Java中getResourceAsStream的用法
  • 原文地址:https://www.cnblogs.com/cb168/p/4314973.html
Copyright © 2011-2022 走看看