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

Get Sorted Column

Thread ID:





12193 Mar 23,2004 05:17 PM UTC Mar 24,2004 09:43 AM UTC WinForms 3
Tags: GridControl
Jose Luis Melo
Asked On March 23, 2004 05:17 PM UTC

Hi, I want to update a databoundgrid datasource, but keep the sorted column sorted. How can I get the sorted column, and its sorting method, and insert it again when datasource is updated ? Thanks, Luis Melo

Administrator [Syncfusion]
Replied On March 23, 2004 05:40 PM UTC

If your datasource is a DataTable, then you can try saving the dataTable1.DefaultView.Sort property. Then after the update, you can reset it. string save = this.dataTable1.DefaultView.Sort; //update things... this.dataTable1.DefaultView.Sort = save;

Jose Luis Melo
Replied On March 24, 2004 08:33 AM UTC

Sorry, I think I forgot to tell you that the Sort I wanted to save was the one I selected in the FilterBar''s grid. If I click on the 3rd column and make the column sorted by that column, then when I update the datasource''s grid, I would like to replace the sort I selected before. Thanks again, Luis Melo

Administrator [Syncfusion]
Replied On March 24, 2004 09:43 AM UTC

Do you mean the filter instead of the sort? If so, you would save and restore the RowFilter property instead of the Sort property. string save = this.dataTable1.DefaultView.RowFilter; //update things... this.dataTable1.DefaultView.RowFilter = save;


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