I am using the NetAdvantage WPF 2009 vol 2 controls. I am looking to have two buttons outside of the grid that will toggle the visibility of the group by area and the filter row. My users don't always know where the group by area is and have requested a button that will expand it. They also want to be able to click a button to hide the filter row when they are not using it.
I expected that changing XamDataGrid.GroupByArea.IsExpanded the group by area would change visibility. I can programmatically set a boolean value to IsExpanded, but the visibility of the group by area does not change. I went through the API reference and could not find any property or method that I could use to accomplish toggling the group by area visibility.
Question?
grid.FieldLayouts.Select - It appears "Select" has been removed. Is there an updated option to extract the Layout Settings as above?
Thanks - Glenn
foreach (FieldSettings settings in grid.FieldLayouts.Select(layout => layout.FieldSettings)) { yield return settings; }
Look at the XamDataGrid.IsGroupByAreaExpanded property to show and hide the Group By area.
The filter row is a little different because it's setting is in the FieldSettings class. The following should work though. This updates the filter setting for all FieldSettings:
foreach (FieldSettings f in GetFieldSettings(sender)) { f.AllowRecordFiltering = true | false; }
private static IEnumerable<FieldSettings> GetFieldSettings(XamDataGrid grid) { yield return grid.FieldSettings; if (grid.FieldLayouts != null) { foreach (FieldSettings settings in grid.FieldLayouts.Select(layout => layout.FieldSettings)) { yield return settings; } } }