Search the Community
Showing results for tags 'FDQuery'.
-
Hello Guys, I'm testing uniGUI Trial version, I would like to know how can I sort each columns of a Desktop UniDbGrid. I tried to follow GridColumnSort demo that is ClientDataSet, but I'm using FireDac. So at MainForm I did: //OnColumnSort event procedure TMainForm.UniDBGrid1ColumnSort(Column: TUniDBGridColumn; Direction: Boolean); begin UniMainModule.SortColumn(Column.FieldName, Direction); end; And at MainModule: uses DB, DBClient; procedure TUniMainModule.SortColumn(const FieldName: string; Dir: Boolean); begin if Dir then Main.MainForm.FDQuery1.IndexName := FieldName+'_ASC' else Main.MainForm.FDQuery1.IndexName := FieldName+'_DSC'; end; procedure TUniMainModule.UniGUIMainModuleCreate(Sender: TObject); var I: Integer; IndexnameAsc : string; IndexnameDes : string; begin with Main.MainForm.FDQuery1 do begin for i := 0 to FieldCount-1 do begin IndexnameAsc := Fields.FieldName+'_ASC'; IndexnameDes := Fields.FieldName+'_DSC'; IndexDefs.Add(IndexnameAsc, Fields.FieldName, []); IndexDefs.Add(IndexnameDes, Fields.FieldName, [ixDescending]); end; end; end; But when I click at column title nothing happens What I miss? Tks
- 2 replies
-
- GridColumnSort
- ColumnSort
-
(and 4 more)
Tagged with: