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

Get Sorted Column

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

3 Replies

AD Administrator Syncfusion Team 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;

JL Jose Luis Melo 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

AD Administrator Syncfusion Team 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;
Live Chat Icon For mobile
Up arrow icon