how to clear sort on this code snippet

Posted on 2009-12-30
Last Modified: 2012-05-08
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);


  I: Integer;

  CurrentView: TcxGridDBTableView;



  CurrentView:= TcxGridDBTableView(Level1.GridView);

  I := CurrentView.Columns[HitColumn].GroupIndex;

  CurrentView.Columns[HitColumn].GroupIndex := -1;

  CurrentView.Items[HitColumn].Tag := 2;

  CurrentView.Columns[HitColumn].HeaderGlyph := nil;


  CurrentView.Columns[HitColumn].GroupIndex := I;



//  CurrentView.DataController.DataSet.Refresh;


Open in new window

Question by:Bianca
    LVL 36

    Expert Comment

    by:Geert Gruwez
    group by requires a sort
    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
    LVL 22

    Accepted Solution

    What about set Column.options.sorting => false?
    This should disable the column sorting leaving the table sorted just by the dataset index (if present)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now