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
715
How to disable expansion of Group By Area when a column is dragged over it?
posted

Hi,

I've configured the XamDataGrid to have a Group By Area at the top and collapsed by default.  When a user tries to remove a field by dragging it out of the grid, because the field got dragged over the Group By Area expander, the Group By Area got expanded.  Is there a way to disable that auto-expansion behavior?

Thanks,

Harold

Parents
  • 6365
    Offline posted

    Hello Harold,

    Thank you for the grouping details you have provided.

    When the GroupByArea is visible and present, in order to disable the expansion behavior, you can handle the Expanded event of the GroupByAreaMulti element by setting its IsExpanded property to false.

    private void dataGrid_Loaded(object sender, RoutedEventArgs e)
    {
        dataGrid.GroupByAreaMulti.Expanded += (se, ev) =>
        {
            (se as GroupByAreaMulti).IsExpanded = false;
        };
    }

    In order to disable the grouping functionality of the XamDataGrid, you can set the FieldSettings.AllowGroupBy property of the XamDataGrid to false.

    dataGrid.FieldSettings.AllowGroupBy = false;


    I have attached a sample application that demonstrates the approach from above.

    If you have any questions, please let me know.

    XamDataGrid_sample.zip
Reply Children