Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2815
Getting visible fields after loading customizations
posted

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?