Disable Group Row selection

Posted by: abellisomi on 9 March 2018, 3:12 am EST

    • Post Options:
    • Link

    Posted 9 March 2018, 3:12 am EST

    Two questions.

    It seems to me that by default the DataGrid allow you to select group row headers.

    Is it possible to disable that and not let people select GroupRows?

    Also, is it possible to have single selection vs multiple?

    Thanks

  • Posted 12 March 2018, 1:11 am EST

    Hello,

    You can disable selection for GroupRows in C1DataGrid using grid’s LoadedRowPresenter event as follows:

    private void grid_LoadedRowPresenter(object sender, C1.WPF.DataGrid.DataGridRowEventArgs e)
            {
                if (e.Row.Type == DataGridRowType.Group)
                {
                    [b]e.Row.IsSelectable = false;[/b]
                }
            }
    ```[b]Re. single selection vs multiple:[/b] I could not completely understand that. Do you mean to restrict the user to select single cell/row/column or multiple row/columns. If this is what you meant then you can use [b]SelectionMode [/b]property of C1DataGrid and set it to SingleRow/SingleRange/SingleColumn/SingleCell/MultiRow/MultiRow etc
    
    Thanks,
    Ruchir Agarwal
  • Posted 12 March 2018, 2:12 am EST

    Ruchir,

    what I meant is to have a different selection mode for the Group row and I imagine I can achieve that with the same approach. Thank you

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels