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;
 

相关文章:

  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
  • 2021-09-20
  • 2021-11-08
  • 2021-09-29
  • 2022-02-23
  • 2021-12-18
猜你喜欢
  • 2022-12-23
  • 2021-04-24
  • 2022-01-23
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案