Skepsis IT Posted June 17, 2013 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. Quote
gerhard.kimmeringer Posted June 17, 2013 Posted June 17, 2013 Hi, it is very easy, in the OnColumnSort Event simply made a new query the direction you want. Quote
alfhabetagama Posted June 25, 2013 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 Quote
Mediv07 Posted June 25, 2013 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 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.