Norm-al
asked on
how to clear sort on this code snippet
I have a special function that sorts a dataset in a grid by picking either by Week, Month, Year. It works great but it forces a sort order on the results, but I don't want to sort by this field. How can I clear the sorting?
procedure TfrmWIPReport.GroupThisColumnByMonth1Click(Sender: TObject);
var
I: Integer;
CurrentView: TcxGridDBTableView;
begin
inherited;
CurrentView:= TcxGridDBTableView(Level1.GridView);
I := CurrentView.Columns[HitColumn].GroupIndex;
CurrentView.Columns[HitColumn].GroupIndex := -1;
CurrentView.Items[HitColumn].Tag := 2;
CurrentView.Columns[HitColumn].HeaderGlyph := nil;
imgLstSortGlyphs.GetBitmap(CurrentView.Items[HitColumn].Tag,CurrentView.Columns[HitColumn].HeaderGlyph);
CurrentView.Columns[HitColumn].GroupIndex := I;
CurrentView.DataController.Refresh;
CurrentView.ViewData.Collapse(true);
// CurrentView.DataController.DataSet.Refresh;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that's the basis of grouping a set of data
what does your data look like ?
maybe you can add a pseudo sort column that does what you need