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.

Sorting

Thread ID:

Created:

Updated:

Platform:

Replies:

11155 Feb 25,2004 03:25 AM Feb 25,2004 01:43 PM Windows Forms 2
loading
Tags: GridControl
Stefan T
Asked On February 25, 2004 03:25 AM

Hi, I am using a DataBoundGrid bound to Dataview with sorting other to default. When I modify the sorting field in an existing row or when I add a new row, then the Grid according to DataView Sorting moves the row to sorting position. Is there any way to prevent this to happen . The new sorting to take place after I leave the Grid or if I explicitly order it. Thanks

Administrator [Syncfusion]
Replied On February 25, 2004 07:34 AM

There is not a simple way to do this as the GridDataBoundGrid just displays what is in the datasource, and dataviews automatically sort themselves when a change is made. There are things you can try to do. One would be to cache all changes locally, and only commit the changes to the datasource when you want things sorted. To do this, you would have to handle SaveCellInfo, and cache the e.Style.CellValue to some local data cache, set e.handled = true, and call grid.Binder.CancelEdit to make sure the grid does not pass the change immediately onto the datasource. Then, you would have to handle grid.Model.QueryCellInfo and if the e.ColIndex and e.RowIndex point to a cache value, then you would set e.Style.CellValue to the cached value provide the correct value. Then you would have to add code to move your cached values to the datasource. One way you could do this is to set some flag that is checked in SaveCellInfo. Then loop through all the cached values and set them into the grid using indexers. Then in SaveCellInfo, if this flag is set, do not execute the caching code, but instead just do nothing and let the grid handle things as it normally would. It is not clear if you would run into any technical problems as you tried to work though this process.

Stefan T
Replied On February 25, 2004 01:43 PM

Thanks , I will try it when I will have time . Also I will try another solution I found today from microsoft knowledge base. To set as datasource a custom dataview, - JoinedView . It has a property AllowSort permitting to set Sort off. http://support.microsoft.com/default.aspx?scid=kb;en-us;325682&Product=vbNET Best Regards

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.

;