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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

how to catch sorting events in databoundgrid?

Thread ID:





13126 Apr 21,2004 07:39 AM UTC Apr 21,2004 08:42 PM UTC WinForms 1
Tags: GridControl
Vincent Lo
Asked On April 21, 2004 07:39 AM UTC

hi, I have got an Expand Grid and i currently allow a single-click sorting on column header. However, everytime i click on the header, all the nodes of my grid collapsed which makes it very annoying. I tried to catch the header clicking event in cell click (when rowIndex == 0) and assign a flag to cancel RowCollapsing event (e.Cancel = m_sorting ,where m_sorting set to true after column header click), but it doesn''t work. I wonder if there''s any event handling specifically designed for sorting? many thanks

Administrator [Syncfusion]
Replied On April 21, 2004 08:42 PM UTC

The problem is that when the Sort is done using the DataView (which is how the GridDataBoundGrid sorts things), it triggers a ListChanged event with type Reset. This Reset is what forces the grid to collapse the nodes. If you use the 2.0 GroupdingGridControl, this will not be a problem. The nodes will not collapse when you sort. If you want try to handle this in the GridDataBoundGrid, it does take some effort. Here is a sample. It adds a new property in a derived grid that adds away to feeze the screen painting through a Win32 API call. This techique is discussed in one of our Windows Forms FAQ, http://www.syncfusion.com/faq/winforms/search/637.asp


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon