structure of my data is follows. it has 3 depth data.
class Panel
{
int panelid;
sting panelname;
ObservableCollection<console> consoles;
}
class Console
int consoleid;
string consolename;
ObservableCollection<Sound> sounds;
class Sound
int soundid;
string sounddata;
// data provider
public ObservableCollection<Panel> GetPanelList()
ObservableCollection<Panel> retVal = new ObservableCollection<Panel>();
for ( int i = 0; i < 10; i++ )
Panel panel = new Panel();
panel.panelid = i;
panel.consoles = new ObservableCollection<Console>();
for ( int j = 0; j < 10; j++ )
Console console = new Console();
console.panelid = i;
console.consoleid = j
console.sounds = new ObservableCollection<Sound>();
for ( int k = 0; k < 10; k++ )
Sound sound = new Sound();
sound.consoleid = j;
sound.soundid = k;
console.sounds.add(sound);
panel.consoles.add(console);
so, i had binding the Panels(ObservableCollection<Panel>) at XamDataGird.
however, my XamDataGrid can display just 2 level data.
my FieldLayout of XamDataGrid is follows.
<igDP:XamDataGrid x:Name="panelInfoGrid" DataSource="{Binding Path=PanelList, Mode=TwoWay}" AutoFit="True"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts>
<!-- Panel Information--> <igDP:FieldLayout > <igDP:FieldLayout.Fields> <igDP:Field Name="panelid" Label="panelid" IsScrollTipField="True" Visibility="Collapsed"/> <igDP:Field Name="panelname" Label="name"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> <!-- Console Information --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="panelid" Label="panelid" Visibility="Collapsed"/> <igDP:Field Name="consoleid" Label="consoleid" Visibility="Collapsed"/> <igDP:Field Name="consolename" Label="consolename"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
<!-- Sound Information --> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="consoleid" Label="consoleid" Visibility="Collapsed"/>
<igDP:Field Name="soundid" Label="soundid"/> <igDP:Field Name="soundname" Label="soundname"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout>
I want to display 3 level hierarchial data when AutoGenerateFields="False"
How can i do this??
I didn't try your example, but I'm surprised the xaml field definitions shown work. I've always had to define a "link" field that enables a child table.
In your panels field layout, I'd think you'd need:
And then in your consoles field layout:
<igDP:Field Name="sounds" />