I have defined the columns of my XamDataGrid using FieldSettings and FieldLayout. But the problem is, that the grid takes all the properties from the "inserted" objects and displays them as columns. This means, that I have to create a specific ViewModel-class for the DataGrid, which is a bit annoying.
The standard WPF DataGrid has an attribute called AutoGenerateColumns. Does the XamDataGrid have something like this? I can't find it...
Thank you Yanko Nikolov. That worked.
Hello,
I have already answered this question in the following forum thread :
http://ko.infragistics.com/community/forums/p/72414/366844.aspx#366844
Stefan,
I have a similar situation and your example helped to a certain extent. However, it fails in a certain scenario. I have modified your solution to reproduce my situation. I have added another class to the Person object and I need to display the "Height" field at the parent row level.
Attached is the modified code. It'll be great if you can help on this. Also, I added a "Number" property to the Cars class. Though the field is displayed correctly, I failed to understand how? Does XamDataGrid compare the rest of the fields to see what collection the FieldLayout belongs to ?
Thanks for your help.
Hello again,
I am glad I helped you resolve this. As for your question I suggest you use the AutoFitMode of the FieldLayoutSettings. You can read about it here:
http://help.infragistics.com/NetAdvantage/WPF/2011.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v11.1~Infragistics.Windows.DataPresenter.AutoFitMode.html
Hope this helps you.
Thanks. That worked great!
Another question. Is it possible to set some kind of "auto-width" on one of the fields? For example, the Name-field would be dynamic, so that the grid "fills" the window..