Guys, after calling XamDataGrid.LoadCustomizations(string) with a valid grid layout string, I get the the FieldLayout successfully created.
If I query the grid for visible fields, I get a list that includes all the fields even though there are some fields with visibility set to collapsed in the original field layout string. Also, when grid is rendered, I see only those fields whose visibility is not collapsed.
I am querying visible fields as follows:
public static StringCollection GetVisibleFieldNames(this XamDataGrid grid)
{
if (grid.FieldLayouts.Count == 0) return null;
var f1 = grid.FieldLayouts[0];
return new StringCollection( f1.Fields.Where(f => f.Visibility == Visibility.Visible).Select(f => f.Name));
}
Any hints on what I am missing?
Nevermind. Problem is me.
Related question though:
After calling XamDataGrid.LoadCustomizations(string), when does the grid actually create these fields? I am noticing that if I query for visible fields immediately after calling LoadCustomizations but with grid not yet rendered, I got no field layouts. Is there a way to determine if grid successfully loaded layout and also get a list of visible fields before grid is rendered?
Joe, this issue is related to the following forum post
http://community.infragistics.com/forums/p/52285/272517.aspx#272517
that has been resolved.
Thanks.
Can you elaborate a bit more on the steps to repro the issue you are seeing? Are you starting with an empty grid (i.e., no field layouts or data) and loading customizations? Do you start with a populated grid (i.e., with data and field layouts) and and then load customizations? Do you have a brief sample that outlines the steps in your scenario? Thx.