How DBGRIDEH implements click on title

xiaoxiao2021-03-06  67

Data source is AdoQuery

1. First set the title-> titlebutton property of the field that needs to be sorted in DBGrideh, TRUE

2, set the Optionseh-> dbhautosortmarking properties of DGGrideh to TRUE

3. Judging in the OntitleButtonClick event in DBGRIDEH.

procedure Tfrmmain.dbgGridEh1TitleBtnClick (Sender: TObject; ACol: Integer; Column: TColumnEh); begin if column.Title.SortMarker = smdowneh then adoQuery1.Sort: = column.FieldName else adoQuery1.Sort: = column.FieldName 'DESC'; END;

转载请注明原文地址:https://www.9cbs.com/read-90071.html

New Post(0)