This is a migrated thread and some comments may be shown as answers.

[Solved] Restrict Radgrid to group more than 1 column.

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benjo
Top achievements
Rank 1
Benjo asked on 03 Feb 2010, 09:13 PM
as we all know that your component has problems on totals when the radgrid is group more than one, so can you suggest to event on how to stop or alert user to group only 1 column in other words prevent them on grouping more than 1 columns so that to the totals are correctly displayed.  thanks..

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Feb 2010, 05:43 AM
Hi Benjo,

You can try the following code snippet in order to prevent the user to group more than one field.

CS:
 
protected void RadGrid1_GroupsChanging(object source, GridGroupsChangingEventArgs e) 
    if (RadGrid1.MasterTableView.GroupByExpressions.Count != 0 && e.Action != GridGroupsChangingAction.Ungroup) 
    { 
        e.Canceled = true
    } 

Thanks,
Princy.
Tags
Grid
Asked by
Benjo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or