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 ?
ADAdministrator Syncfusion Team March 23, 2004 12:40 PM
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;
this.dataTable1.DefaultView.Sort = save;
JLJose Luis MeloMarch 24, 2004 03:33 AM
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.
ADAdministrator Syncfusion Team March 24, 2004 04:43 AM
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;
this.dataTable1.DefaultView.RowFilter = save;