Hi,
I have a xamdatagrid that's contains a hierarchical dataset. The DataSource for the data set is part of the data context. When I refresh the DataSource, the grid essentially re-initializes and all of the rows collapse again. Is there a way to keep the expanded rows after the refresh? I'm not sure if I'm setting the data source correctly by overwriting the old one which forces the re-initialization.
Thanks,
Kyle
I have wrote an event handler for initializerecord and it is working. Thanks so much for all of your help!
Hello Kyle,
Currently there is no built-in mechanism to save the expanded state of the records. When the data source is changed, new data records are created which have no notion of the expanded status of the records before them. You could manually save the indices of all the records before changing the data source and restore the expanded state in the initialize records event. You can use the e.ReInitialize property to execute this code only when the record initializes for the first time.