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;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/8962414.html