/// <summary> /// Handles the OnGroupingRender event for the WrapDataGrid. /// </summary> /// <param name="sender">Sender of the event.</param> /// <param name="e1">The <see cref="Microsoft.Cui.Controls.GroupingRenderEventArgs"/> instance containing the event data.</param> private void WrapDataGrid_OnGroupingRender(object sender, System.EventArgs e1) { GroupingRenderEventArgs e = e1 as GroupingRenderEventArgs; if (sender != null && e.GroupingHeader != null) { Grid groupHeader = e.GroupingHeader as Grid; if (groupHeader != null) { Button expandCollapse = groupHeader.FindName("ExpandCollapse") as Button; if (expandCollapse != null) { expandCollapse.Tag = e.GroupingKey; } } } }
/// <summary> /// Handles the OnGroupingRender event for the WrapDataGrid. /// </summary> /// <param name="sender">Sender of the event.</param> /// <param name="e1">The <see cref="Microsoft.Cui.Controls.GroupingRenderEventArgs"/> instance containing the event data.</param> private void WrapDataGrid_OnGroupingRender(object sender, System.EventArgs e1) { GroupingRenderEventArgs e = e1 as GroupingRenderEventArgs; if (sender != null && e.GroupingHeader != null) { Grid groupHeader = e.GroupingHeader as Grid; if (groupHeader != null) { //// ALTERED to remove "findname" from WPF version Button expandCollapse = groupHeader.Children[0] as Button; if (expandCollapse != null) { expandCollapse.IsTabStop = true; expandCollapse.Tag = e.GroupingKey; } } } }