I want to use the TreeDataGrid in order to show a hierarchy with heterogeneous elements. All samples I have seen use nodes of the same type (e.g., Person).
For simplicity and because I cannot share confidential data about my use case, let's say my data structure is similar to a Team -> Players structure. The Team has a name and a city, while a Player has a name and age. (In my particular use case, there will be only one level of depth, like in this toy example)
I have implemented this using a fictitious TeamPlayerNode that mixes both classes Team and Player - this is a screenshot from the resulting UI, and it is roughly what I want to achieve:
My question: Is there a cleaner way to implement this? I am concerned with the "cleanliness" of my code going forward with this hybrid TeamPlayerNode.
I want to use the TreeDataGrid in order to show a hierarchy with heterogeneous elements. All samples I have seen use nodes of the same type (e.g., Person).
For simplicity and because I cannot share confidential data about my use case, let's say my data structure is similar to a Team -> Players structure. The Team has a name and a city, while a Player has a name and age. (In my particular use case, there will be only one level of depth, like in this toy example)
I have implemented this using a fictitious TeamPlayerNode that mixes both classes Team and Player - this is a screenshot from the resulting UI, and it is roughly what I want to achieve:
My question: Is there a cleaner way to implement this? I am concerned with the "cleanliness" of my code going forward with this hybrid TeamPlayerNode.