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
2325
Hieararchical Grid : Do not show Headers for Child Elements.
posted

Hi,

I have a class as below ::

public class Person
{
public string Name { get; set; }
public int Age { get; set; }
private ObservableCollection<object> _sample = new ObservableCollection<object>();

public ObservableCollection<object> sample
{
get
{
return _sample;
}
set
{
if (_sample == value) return;
_sample = value;

}
}

}

In the Main window constructor I have code as below::

List<object> data = new List<object>();

Person p = new Person();
Person child = new Person();
child.Age = 10;
child.Name = "Child1";
p.Name = "Parent1";
p.Age = 30;
p.sample.Add(child);

Person p1 = new Person();
Person child1 = new Person();
child1.Age = 10;
child1.Name = "child2";
p1.Name = "Parent 2";
p1.Age = 30;
p1.sample.Add(child1);

data.Add(p1);


Person p2 = new Person();
Person child2 = new Person();
child2.Age = 10;
child2.Name = "child3";
p2.Name = "parent 3";
p2.Age = 30;
p2.sample.Add(child2);

data.Add(p2);

this.DataContext = data;
}

XAML for xam grid is :: 

<igDP:XamDataGrid DataSource="{Binding}" Name="xamDataGrid1" VerticalAlignment="Top" >
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" />
</igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout>
<igDP:Field Name="Age"/>
<igDP:Field Name="Name"/>
<igDP:Field Name="sample"/>

</igDP:FieldLayout>





</igDP:XamDataGrid.FieldLayouts>

</igDP:XamDataGrid>

My Question is

1. I should not show the Headers for child elements in this case for  the property Sample

2. Even if there are no children control is still showing (+) sign. If any child has no sub child then (+) should not be shown.


How can i achieve this, Thanks 


Parents Reply Children