I have a WebDataGrid Version=9.2.20092.1003
I have attached a project file with simple sample.
I have two different datasets in one page. I change data sources by clicking button to load authors or animals.
The problem is if you load authors data and click on author'c column to sort by that column, then you click on animals button, it supposed to clear all behaviors but after it loads data and you click on next page it throws an error related to previous author column sort by not found.
Please see attached zip file.
Hello,
Can you try clearing the SortedColumns collection off of the sorting behavior prior to changing the data source? Hopefully this will help. Another method to try out is the ClearDataSource() method off the grid, which should be called before different data source is attached.
Hi Alex,
Unfortunetely it did not work.
See code below. Any other suggestion?
OscarG
private void ClearGrid()
{
WebDataGrid.Behaviors.Filtering.ClearBehaviorColumnInfo();
WebDataGrid.Behaviors.Filtering.ApplyFilter();
WebDataGrid.Behaviors.Sorting.SortedColumns.Clear();
WebDataGrid.Behaviors.Sorting.ColumnSettings.Clear();
WebDataGrid.ClearDataSource();
WebDataGrid.Behaviors.Paging.PageIndex = 0;
}
Hi,
I tried the webdatagrid1.rows.clear() by me and it fixed my problem. You have to also do a webdatagrid1.databind(). The rows.clear forces the grid to listen to a subsequent databind() command.
Ed
It neither worked.
Thanks
Hm, I'd thought this should do it. My last suggestion is to call WebDataGrid.Rows.Clear(); if it does not work after that I'd suggest contacting the dev support.