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;