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

prevent the group from being deleted and collapsed

2 Answers 12 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andre
Top achievements
Rank 1
Andre asked on 06 Dec 2018, 09:28 AM
how can i prevent the group from being deleted ?
how can i prevent the group from collapsing ?

best thanks 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 06 Dec 2018, 11:51 AM
Hi Andre,

You can use the  and GroupByChanging events for this. Here is an example:
public RadForm1()
{
    InitializeComponent();
    radGridView1.DataSource = GetTable();
 
 
    radGridView1.GroupByChanging += RadGridView1_GroupByChanging;
    radGridView1.GroupExpanding += RadGridView1_GroupExpanding;
}
 
private void RadGridView1_GroupExpanding(object sender, Telerik.WinControls.UI.GroupExpandingEventArgs e)
{
    if (e.IsExpanded )
    {
        e.Cancel = true;
    }
}
 
private void RadGridView1_GroupByChanging(object sender, Telerik.WinControls.UI.GridViewCollectionChangingEventArgs e)
{
    if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove)
    {
        e.Cancel = true;
    }
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Andre
Top achievements
Rank 1
answered on 06 Dec 2018, 12:40 PM

hi dimitar

thanks a lot. it works.

great service !!!

andre

Tags
GridView
Asked by
Andre
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Andre
Top achievements
Rank 1
Share this question
or