Hello,
I have a hierarchical grid bound to a hierarchical data source. When I need to change the hierarchy, i modify the datasource then re-set the datasource property on the grid, but the problem is when i do this, the users current location gets reset, and all the bands collapse which is very annoying. Is there a better way to rebind the grid after the hierarchy changes? I tried Refresh, Rebind, but that doesn't work.
Thanks
Hi,
If you set (or re-set) the DataSource on the grid, all of the grid rows are destroyed and a completely new set of rows are created based on the new data source. So there is no way that the grid can maintain any kind of row or cell level state information, such as the ActiveRow, SelectedRows, or Expanded states of the rows.
The best thing to do is to avoid resetting the data source whenever possible.
What kind of DataSource are you using for the grid? And what kind of changes are you making to the structure of the data?
If you are using a DataSource that implements IBindingList, then you should not have to reset the grid's DataSource, because the DataSource will notify the grid of any changes in structure and the grid will update automatically.
I am using a BindingList. It does not update automatically. Do I need to do anything for it to update automatically?
I am using version 6.2.