The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
ADAdministrator 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;
JLJose Luis MeloMarch 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
ADAdministrator 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;