Hi,
I'm using the XamDatagrid to display hierarchical data with manually defined field layout (i.e. AutoGenerate=false).
My object looks something like this:
class obj {
string Name;
List Properties;
List Objects;
}
And here's the field layout:
<igDP:FieldLayout Key="MyObj"> <igDP:FieldLayout.Fields> <igDP:Field Name="Name"> <igDP:Field.Settings> <igDP:FieldSettings AllowEdit="False" /> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Objects" /> <igDP:Field Name="Properties" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
The problem is, the data isn't quite displayed how I'd like to be it. Because I have 2 lists ("Objects" and "Properties"), instead of expanding to a single "merged" view of both lists, I get something like this:
Thing is, I don't want to see "Objects" and "Properties" nodes on the tree. Note that if I only had one list, e.g. I remove "Properties" from the field layout, then it won't display a "Properties" node and instead each property object will display as a direct child of setting1.
I guess I could solve this by modifying my View Model, but I'm wondering if there's an easier way.
Thanks!
Hello Danny,
I am just checking if you have any further question on this matter. Please do not hesitate to let me know if you do.
I have been looking into your post.
I have modified the sample application, that you have provided. In the modified sample application I have added the property, that I have proposed in my previous post and have removed the style for the ExpandableFieldRecordPresenter.
Please find the modified sample application attached and feel free to let me know if you have any further questions on this matter.
Thank you for your response.
Unfortunately, this does not solve the problem. Using the arrow key still goes to the invisible zero height record presenter.
Could you perhaps create a sample demonstrating this?
Thank you for the provided sample application.
I have been looking into it. In order to be able to navigate through the parent and children records I can suggest you to set the ExpandableFieldRecordExpansionMode property of the FieldSettings of the XamDataGrid too. By setting it to ExpandAlways the focus from the parent record would go directly to the child record when you navigate with the arrow keys.
Please do not hesitate to let me know if you have any further questions on this matter.
See attached sample.
Here are the steps to reproduce the problem:
1. Run the sample.
2. Click on the first row.
3. Press right arrow key on keyboard to expand.
4. Now press the down arrow. Where did the focus go? If you use WPF Snoop, you will see it is on the ExpandableFieldRecordPresenter, but we set the height of that to 0 (intentionally to hide it). So the end result is in order to actually go one row down, you need to hit the down key twice. This is counter-intuitive.