Can anyone show me a quick example of creating a new fieldLayout in C# in the code behind?
I've tried something like this, but it doesn't seem to properly apply the fieldLayout I've created.
this.xamDataGrid.DataSource = GetData().DefaultView; Field field = new Field(); field.Name = "Column1";
FieldLayout fieldLayout = new FieldLayout(); fieldLayout.Fields.Add(field); this.xamDataGrid.FieldLayouts.Add(fieldLayout); this.xamDataGrid.DefaultFieldLayout = fieldLayout;
Thanks for any help.
Gabe
Working with FieldLayouts is more complicated than that. I suggest you read the documentation which provides an overview of the topic to better understand how the grid uses them.
http://help.infragistics.com/Help/NetAdvantage/WPF/2007.1/CLR3.X/HTML/xamData_Terms_Fields_Field_Layout.html
Hi John,
It is indeed complicated. In the documentation you linked
Field Layouts don't have names, but instead are matched by the series of Field objects they contain against the "attributes" it can identify on the Data Item.
Where can I find more information about what exactly the match logic is?
I am having some issues with field layout matching. I have two similar child bands, the schema of one is a superset of the schema of another. The grid insists giving the same lesser fieldlayout to both two bands.
It will be nice to know what property on which object the matching logic is referring to before making a decision, so I can debug this further. My data source is an IBindingList.
Thanks
Good article. Thanks Josh.
Indeed it is more complicated, but also flexible than I orginally thought.