I'm new to WPF, so maybe it's something I'm doing wrong.
I have a XamDataGrid with 3 unbound columns and no data. The headers are not being displayed at design or run time. I've see posts going as far back as 2008 that are still unresolved: http://es.infragistics.com/community/forums/p/10948/223801.aspx#223801 is 1 of them. Is this a known issue with 2012.1 that I'm seeing or might it just be part of the WPF learning curve?
Thanks
Hello jrelyea,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Indeed this has been discussed a number of times. In order for the XamDataGrid to show headers it needs to have an usable FieldLayout, meaning that whether there is only or many FieldLayouts declared in the collection the XamDataGrid will use one that which Fields match the DataSource’s properties. For this of course some DataSource must be said. Here is also a more detailed description of the properties/Fields matching logic: http://es.infragistics.com/community/blogs/petar_monov/archive/2011/05/13/how-to-define-fieldlayouts-how-fieldlyouts-are-mapped.aspx .
When it comes to UnboundFields and if the whole FieldLayout consists only of UnboundFields e.g.:
<igDP:FieldLayout >
<igDP:FieldLayout.Settings>
<igDP:FieldLayoutSettings AutoGenerateFields="False" />
</igDP:FieldLayout.Settings>
<igDP:UnboundField Label="Name" />
<igDP:UnboundField Label="Age" />
<igDP:UnboundField Label="Salary" />
</igDP:FieldLayout>
there is nothing to match, however there still should be some DataSource set. Even this works:
xamDataGrid1.DataSource = "";
Please let me know, if I can be of any further assistance on the matter.