I am saving/loading the layout but this doest keep which rows have been expanded/collapsed, is there an easy way to preserve this or should I listen for expand/collapse events and store their status myself so I can save/load them separately.
Hi,
No, there's no easy way to do this. The Layout does not include any row-specific properties, because this would mean saving the data. Obviously, it doesn't make any sense to save the data as part of the layout.
You would have to store this using some kind of key information for each row, because remember, the data might not be the same the next time you run the applicaiton and the Row objects certainly won't be the same objects.
OK, I don't normally use databound controls, I have created another table in my dataset to store information about the rows in my main employee table, whether they are expanded, selected, etc. Is there an easy way to find the primary key of the source row from the datagrid row object? Then I can link this to my own extended row properties table.