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

how to catch sorting events in databoundgrid?

Thread ID:

Created:

Updated:

Platform:

Replies:

13126 Apr 21,2004 03:39 AM Apr 21,2004 04:42 PM Windows Forms 1
loading
Tags: GridControl
Vincent Lo
Asked On April 21, 2004 03:39 AM

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 04:42 PM

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

CONFIRMATION

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.

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.

;