How to define FieldLayouts (How FieldLyouts are mapped)?

[Infragistics] Petar Monov / Friday, May 13, 2011
When it comes to defining the display of data in the XamDataGrid, the first place to go to is the documentation: http://help.infragistics.com/Doc/WPF/2012.2/CLR4.0/?page=xamDataGrid_Defining_Layouts.html , however after reading this many people have some additional questions, which I will try to cover in this post.  

When applying data to the XamDataGrid, there are basically two options you can choose from the FieldLayoutSettings: 

AutoGenerateFields = True  -  All fields are automatically created based on the data object’s properties. When a Field is explicitly defined, if you correctly set its Name property to a property (field) in your data object, you mostly start modifying only the layout since all Fields are already there. As a result the if you explicitly define one Field it will actually appear as your first column. On the other hand if you mistype the Name value you will make the FieldLayout invalid and the automatically generated one will be used.

AutoGenerateFields = False - No Fields are generate and no FieldLayout whatsoever. This means that a FieldLayout and the properties of your data object, that you want to visualize in your DataRecords, have to be explicitly defined. In this scenario the Name propertis of all the Fields have to be accurate, in order for the FieldLayout to be recognized as legitimate for the specific DataSource. If you have a 100 fields in your object and want to visualize only a few or several you can create a FieldLayout with only those Fields defined. In case you mistype a single letter the whole FieldLayout, you have been designing, is left out and the XamDataGrid does no display anything, even though it contains data. Also there is no notification (exception, error message or text in the XamDataGrid) if there is no FieldLayout match for the data you have provided. This is so because the XamDataGrid cannot decide whether the FieldLayouts collection does not contain a matching layout intentionally or my mistake.  

Hope this helps.