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;

上一篇:Delphi WMI[2] 响应网线断开


下一篇:修改delphi 窗体名称