Forums
Forums are Read-Only. Use the new Support Center. To start a general discussion, use the General category when submitting your question.

Remove Sorting Event

Last post 2/7/2012 4:58 AM by Tristan Niewisch. 5 replies.
Sort Posts: Previous Next
  • Hakan Turan

    Remove Sorting Event

    1/6/2009 7:57 AM
    • Not Ranked
    • Joined on 12/10/2008
    • Posts 23

    How can I trap the remove sorting event on a colum? (i.e. user Ctrl-Clicks)

    StartSorting and EndSorting do not capture this event.

     

    Thank you.

  • Brendon Muck [DX Squad]

    Re: Remove Sorting Event

    1/6/2009 12:13 PM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 6,154

    This may work for you:

     

            private void MyGridview_MouseDown(object sender, MouseEventArgs e)

            {

                DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi = MyGridView.CalcHitInfo(e.X, e.Y);

     

                if (hi.InColumn == true && e.Button == MouseButtons.Left)

                {

                    if (Control.ModifierKeys == Keys.Control)

                    {

                        //Sorting was cleared

                    }

                }

            }

    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Hakan Turan

    Re: Remove Sorting Event

    1/6/2009 2:30 PM
    • Not Ranked
    • Joined on 12/10/2008
    • Posts 23

    Thats great, thanks a lot Geeked

  • Tristan Niewisch

    Re: Remove Sorting Event

    2/6/2012 10:26 AM
    • Not Ranked
    • Joined on 4/12/2010
    • Posts 5

     Hello DevExpress Team,

    i have the same problem like Turan, but the users use the contextmenu to remove the sorting. Is there also a solution to react on this userinput?

    I'm useing the DevExpress components v11.1.8.0.

    Thank you.

  • Brendon Muck [DX Squad]

    Re: Remove Sorting Event

    2/6/2012 10:39 AM
    • Top 10 Contributor
    • Joined on 5/16/2007
    • Buffalo, NY
    • Posts 6,154
    Try handling the View's GridMenuItemClick event. It will tell you which menu item was clicked, and you can react accordingly.
    Please do not email me directly for support. Use the Support Center or Community Forums so that everyone may benefit.
  • Tristan Niewisch

    Re: Remove Sorting Event

    2/7/2012 4:58 AM
    • Not Ranked
    • Joined on 4/12/2010
    • Posts 5

    Great! It works.

    Thanks a lot

More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.