We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Capturing event after sort on DataBoundGrid

Hi, Is there a way to capture the sort event so I can select the first row in the grid after it is sorted? I really need this functionality. Thanks Andy J

5 Replies

AD Administrator Syncfusion Team March 23, 2004 12:34 PM

You can catch the grid.Model.ClipboardPasted event. It is discussed in this forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12155


AD Administrator Syncfusion Team March 23, 2004 12:52 PM

Umm I"m not pasting anything, I need to capture the sort event on a databound grid... I''m not using the clipboard for anything... Sorry for the confusion Andy J >Hi, > >Is there a way to capture the sort event so I can select the first row in the grid after it is sorted? I really need this functionality. > >Thanks > >Andy J


AD Administrator Syncfusion Team March 23, 2004 02:14 PM

I am sorry, I misread your request. Currently, there are no events fired related to sorting. But ycan derive the GridDataBoundGrid, and override the SortColumns method. In your override, you could raise a presort event, call the baseclass, and then raise a postsort event. If you do not want to add your own events, you could add a public field or property bool inSort, and set this property before the call to the baseclass, and reset it after the call to the baseclass. You could then test this flag to know when you are sorting.


AD Administrator Syncfusion Team March 23, 2004 02:15 PM

I am sorry, I misread your request. Currently, there are no events fired related to sorting. But ycan derive the GridDataBoundGrid, and override the SortColumns method. In your override, you could raise a presort event, call the baseclass, and then raise a postsort event. If you do not want to add your own events, you could add a public field or property bool inSort, and set this property before the call to the baseclass, and reset it after the call to the baseclass. You could then test this flag to know when you are sorting.


JL Jose Luis Melo March 24, 2004 09:09 AM

Hi Andy, You can do it like I did. You select the sort event with only only click... In the grids''s properties: GridDataBoundGrid.SortBehavior = Syncfusion.Windows.Forms.Grid.GridSortBehavior.SingleClick And in the GridDataBoundGrid.DoubleCLick event select the first or any other row: GridDataBoundGrid.ForceCurrentCellMoveTo = True GridDataBoundGrid.CurrentCell.MoveTo( row, column) This double click event will always happen after the first click sort event. Jose Melo

Loader.
Live Chat Icon For mobile
Up arrow icon