Hi.
I have a requirement in my project to restore expand/collapse state of groups. I thought that the best place for this logic is InitializeRecord event handler. It works fine if i have one level of groupings, but when there are more than one level of groupings it does not work. Because there could be the following situation:
- Group1
- Group11
Item1
item2
- Group12
Item3
Item4
+Group2
- Group21 (currently invisible)
item5
item6
When groups are restored the "Group2" have expanded state. I think this is because records are initialized from parents to children and when i restore expanded state of "Group21" the "Group2" expands too.
Could you provide a solution to my issue?
Thank you for your quick reply.
I don't think that it will work for me. I have found another resolution of my issue.
I restore expand/collapse state of the grouping row inInitializeRecord event handler, but if the parent of the row is collapsed than we don't restore its state. State of such rows will be restored after its parent will be expanded.
Hello,
One option is to create a style for the DataRecordPresenter and either bind the IsExpanded property of the record to a boolean property in your datasource or use a converter for the value. In the converter you may check the index of the DataRecord, the layout etc.
Let me know if that works for you.