Hi There,
I have a list of Accounts and each Account has various details and also a list of specific details. How can I display this data in xamDataGrid?
xamDataGrid->DataSource = List<Account>
Account
{
string field1
string field2,
string field3,
List<string> listOfFields
........
}
Hello Nasir,
Thank you for your post. I have been researching your issue and created a small sample for you.
Please find the attached sample and do not hesitate to contact us if you have any further issues.
Gergana,
Thanks for your reply and sample app. It really helped.
I don't want auto generated fields in the grid. Because I don't want to hide some of fileds (columns) in grid and I want to format fields differently. How can I do that. I made following changes in the code but it isn't working as I would like to,
==========================================================================
<igDP:XamDataGrid Name="myDataGrid" DataSource="{Binding}" Theme="IGTheme">
<igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" /> </igDP:XamDataGrid.FieldLayoutSettings>
<igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:Field Name="field1" Label="Field1" Width="100"/> <igDP:Field Name="field2" Label="Field2" Width="100"/> <igDP:Field Name="field3" Label="Field3" Width="100"/> <!--<igDP:Field Name="ListOfDetailses.detail1" Label="Field" Width="100"/>--> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
-------------------------------------------------------
ObservableCollection<Accounts> data = new ObservableCollection<Accounts>();
data.Add(new Accounts { field1 = "text1", field2 = "text1", field3 = "text1",
ListOfDetailses =new List<AccountDetails>
new AccountDetails{detail1="a1",detail2="a2"},
new AccountDetails{detail1="b1", detail2="b2"},
new AccountDetails{detail1="c1", detail2="c2"},
DataContext = data;
============================================================================
Please let me know.
Thanks
Nasir