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

Default Grouping of RadGrid can not be deleted

1 Answer 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajneesh
Top achievements
Rank 2
Rajneesh asked on 11 Aug 2011, 10:57 AM
Hi,
I have requirement that no one can delete default grouping. User can add more columns for grouping and can delete them but i have added one column as default group that column can not be deleted from Grouping section.
 Hope you understand.

Image is attached for better understanding.

Thanks....

1 Answer, 1 is accepted

Sort by
0
Rajneesh
Top achievements
Rank 2
answered on 11 Aug 2011, 11:58 AM
Hi,
I have done it as:
Protected Sub radGrd_GroupsChanging(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridGroupsChangingEventArgs) Handles radGrd.GroupsChanging
        If e.Action = GridGroupsChangingAction.Ungroup Then
            If e.Expression.GroupByFields(0).FieldName = "YourFieldName" Then
                e.Canceled = True
            End If
        End If
    End Sub

May be helpful for others........ :-)
Thanks....
Tags
Grid
Asked by
Rajneesh
Top achievements
Rank 2
Answers by
Rajneesh
Top achievements
Rank 2
Share this question
or