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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridDataBoundGrid Tree Grid Sorting Problem.

Thread ID:





16065 Jul 6,2004 02:57 AM UTC Jul 6,2004 05:04 AM UTC WinForms 1
Tags: GridControl
Maqsood Ahmed
Asked On July 6, 2004 02:57 AM UTC

I am working working on a GDBG that has Hierarchical View (Tree view) and it is bound to 2 different views. I switch between views on the basis of an event. now when I sort GDBG using SortBehaviour = SingleClick. The whole grid collapses first and then start to sort. Is there anyway to sort a Grid without affecting its current state??

Administrator [Syncfusion]
Replied On July 6, 2004 05:04 AM UTC

There is no property setting that allows this to happen. In the case of sorting, the datasource fires an IBindingList.ListChanged event with a ListChanged.Reset setting. This causes the nodes to reset. To handle this, you can save teh state before sorting, and reset it after sorting. One problem is that the reset also cancels any grid.BeginUpdate which then shows the nodes changing which is not good. One way to handle this is use a Win32 API directly freeze the painting instead of using grid.BeginUpdate. Here is a sample that works around this problem. It adds a new property to a derived grid that adds a second way to freeze 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