I have a WebDataGrid in my application with couple of BoundedDataField and other TemplateDataField.
After I assigned the DataSource and binding it to the WebDataGrid, I am manipulating the columns.
Once I sort any column, it displayed the data correctly in grid but when I do it multiple times, it does not seem to be refreshing the columns and it displays incorrct values in the grid column.
Till now I have tried with following options:
1)
oWebDataGrid.DataSourse = null;
oWebDataGrid.DataBind();
oWebDataGrid.DataSourse = <Some Data Source>;
2)
oWebDataGrid.Rows.Clear();
oWebDataGrid.ClearDataSource();
3)
oWebDataGrid..RequestFullAsyncRender();
I have checked it in debug mode that I am getting the correct DataSource values.
Is there any way I can forcefully render the grid again to display column values again.
Any help will be greatly appreciated.
Thanks in advance.
In my case when I Insert, update or delete using sql setences with WDG1.DataBind() refresh the grid with the data updated.
do this before you reassign to your datasource
wdg.Behaviors.Sorting.SortedColumns.Clear()
Hello yogeshM23,
Your code uwGrid.Columns.Clear(); should be working. Can you share s small sample, reproducing the error you are getting?
Hi.
I had the same problem, after hours struggling I found Rows.Clear is the solution. Below is my data binding code.
WebHierarchicalDataGrid1.Rows.Clear()
WebHierarchicalDataGrid1.DataSource = ds
WebHierarchicalDataGrid1.DataBind()
Good luck!