unidbgrid列排序

unidbgrid列排序

1)指定列的.sortable:=true;

2)unidbgrid.columnsort事件添加如下代码:

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;
 
posted @ 2018-04-27 14:51  delphi中间件  阅读(1429)  评论(0编辑  收藏  举报