Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2165
Hierarchical data expansion
posted

Hi,

What i'm trying to achieve is to have a hierarchical XamdataGrid in which i can add items with the "New"
context menu command, and to these items i can add child entries with the "New Detail" context menu command.
And the rows should only have expanders when they have children. So far I've run into a lot of problems, for example,
if i hide the + for a row who has no children, and then add child items to it, even if i set the visibility of the + back to normal,
it doesn't work anymore(doesn't expand, just changes icon).

I've tryed this with both collections as ObservableCollection and BindingList also.

Can you suggest a solution?

Parents
No Data
Reply
  • 34810
    Verified Answer
    Offline posted

    Hello,

    Rather than programmatically hiding or showing the expansion indicator in the XamDataGrid, I would recommend that you set the XamDataGrid.FieldLayoutSettings.ExpansionIndicatorDisplayMode property to "CheckOnDisplay." This property will automatically show or hide the expansion indicators of the XamDataGrid on a row-by-row basis depending on whether or not that particular row has child records or not.

    I have attached a sample project that adds new rows to the XamDataGrid through usage of a context menu, and this appears to work as expected. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer

    XDGAddChildDynamicallyCase.zip
Children