其他分享
首页 > 其他分享> > Delphi DEV 排序 转 RO 排序

Delphi DEV 排序 转 RO 排序

作者:互联网

DEV 排序 转 RO 排序

procedure devToRoSort(AGtv:TcxGridDBTableView;ATbl:TDAMemDataTable);

procedure TfrmICMO_10.devToRoSort(AGtv:TcxGridDBTableView;ATbl:TDAMemDataTable);
var
I: integer;
FieldNames:array of string;
Directions:array of TDASortDirection;
begin
// dev 排序 转 RO 排序
SetLength(FieldNames,AGtv.SortedItemCount);
SetLength(Directions,AGtv.SortedItemCount);
//TdxSortOrder = (soNone, soAscending, soDescending); (0,1,2)
//TDASortDirection = (sdAscending, sdDescending); (0,1)
for I := 0 to AGtv.SortedItemCount - 1 do begin
//升降序
case AGtv.SortedItems[I].SortOrder of
soNone: Directions[I] := TDASortDirection.sdAscending;
soAscending: Directions[I] := TDASortDirection.sdAscending;
soDescending: Directions[I] := TDASortDirection.sdDescending;
end;
//列
FieldNames[I] := AGtv.SortedItems[I].DataBinding.DefaultCaption;
end;
ATbl.Sort(FieldNames,Directions);
end;

标签:排序,end,Delphi,FieldNames,TDASortDirection,Directions,AGtv,RO
来源: https://blog.csdn.net/qq_17820893/article/details/119063699