var
OldIndex: string;
begin
OldIndex:= cds.IndexName;
if OldIndex <> '' then
begin
cds.IndexName:= '';
cds.DeleteIndex(OldIndex);
end;
case Column.Title.SortMarker of
smNoneEh,
smUpEh :
begin
cds.AddIndex('px', NewIndex, [ixDescending]);
Column.Title.SortMarker:= smDownEh;
end;
smDownEh:
begin
cds.AddIndex('px', NewIndex, [ixPrimary]);
Column.Title.SortMarker:= smUpEh;
end;
end;
cds.IndexName:= 'px';
end
浙公网安备 33010602011771号