开发者

XamDataGrid Hierarchical Structure with same Datatype

开发者 https://www.devze.com 2023-02-18 23:29 出处:网络
I\'m new in the XamDataGrid-Topic. Currently I\'m playing around with the XamDataGrid to find out what functionality is offered.

I'm new in the XamDataGrid-Topic. Currently I'm playing around with the XamDataGrid to find out what functionality is offered.

I already have two questions:

I have hierarchical Data that looks like this:

public class TestDTO

{

public int Id { get; set; }

public string Description { get; set; }

public ObservableCollection Children { get; set; }

}

My Xaml FieldLayouts looks like this:

My xaml can't be shown...

I want to display the Data Like this:

Column Id | Column Description

  • 123 | Description123

  • 234 | Description234

    456 | ChildDescription456

  • 567 | Description567

The problem is: It seems, that just the "parentLayout" is used by the XamDataGrid. Changes in the "childLayout" are not accepted. Additionally the Column-Headers are displayed in the child-level, although the LabelLocation = Hidden. Is there a general problem when the top-level dataType is the same as the child-level?

That brings me to my next question:

Is it possible to synchronise the开发者_开发百科 columns of the ParentLayout with the ones of the childLayout? So they have the same alignment but the expansion-indicator is still intended.

Thank you in advance!


Firstly, XamDataGrid works with BindingList<T>. So change your Children collection to a BindingList<T>. Also, did u create separate field layouts for parent and child? In the child layouts FieldLayoutSettings set LabelLocation="Hidden"


I had the same issue. When child datatype was different the grid worked fine. When the child datatype was the same type as the parent, it would use the parent's layout. I started adding the properties from this post: enter link description here

It was setting the ParentFieldLayoutKey prop on the child layout that made the grid start observing the child layout.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号