Skepsis IT Posted June 17, 2013 Share Posted June 17, 2013 Hi to all Unigui Community, after a research on the forum I don't find how to sort columns on unidbgrid. There is a demo that does it but no source code. Moreover I enabled the option sortable, menu is enabled, but does not sort anything. Thanks for your time. Link to comment Share on other sites More sharing options...
gerhard.kimmeringer Posted June 17, 2013 Share Posted June 17, 2013 Hi, it is very easy, in the OnColumnSort Event simply made a new query the direction you want. Link to comment Share on other sites More sharing options...
alfhabetagama Posted June 25, 2013 Share Posted June 25, 2013 Hi, it is very easy, in the OnColumnSort Event simply made a new query the direction you want. hi Gerhard and others or advance i want each column sortable, at time properties -> Sortable:=true; but couldn't sorting I use this query to show data , SELECT *, concat(desitem,' ',unit,' isi ',unitqty) as desitemdisplay, concat(codeitem,'-',desitem,' ',unit,' isi ',unitqty ) as codedisplay FROM (tbllistitem1 itm1 INNER JOIN tblitemwh itmwh on itm1.iditem=itmwh.iditem) INNER JOIN tblcodewh codewh on itmwh.idcode=codewh.idcode WHERE itmwh.codeitem LIKE '%MR%' order by codewh.descode asc, itmwh.codeitem asc bold characters are currently sorting. Pls help me, thank before Has Link to comment Share on other sites More sharing options...
Mediv07 Posted June 25, 2013 Share Posted June 25, 2013 procedure TIndSourceFrame.IndSourceGridColumnSort(Column: TUniDBGridColumn; Direction: Boolean); begin if not (IndSourceQuery.Eof and IndSourceQuery.Bof) then begin if SameText(Column.FieldName, 'IND_SRC_CODE') then begin if Direction then IndSourceQuery.IndexFieldNames := Column.FieldName + ' asc' else IndSourceQuery.IndexFieldNames := Column.FieldName + ' desc' end; if SameText(Column.FieldName, 'IND_SRC_NAME') then begin if Direction then IndSourceQuery.IndexFieldNames := Column.FieldName + ' asc' else IndSourceQuery.IndexFieldNames := Column.FieldName + ' desc' end; if SameText(Column.FieldName, 'RASH_TYPE') then begin if Direction then IndSourceQuery.IndexFieldNames := Column.FieldName + ' asc' else IndSourceQuery.IndexFieldNames := Column.FieldName + ' desc' end; if SameText(Column.FieldName, 'SHOW_TYPE') then begin if Direction then IndSourceQuery.IndexFieldNames := Column.FieldName + ' asc' else IndSourceQuery.IndexFieldNames := Column.FieldName + ' desc' end; end; end; 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now