prevent the group from being deleted and collapsed

3 posts, 1 answers
  1. Andre
    Andre avatar
    41 posts
    Member since:
    Feb 2018

    Posted 06 Dec 2018 Link to this post

    how can i prevent the group from being deleted ?
    how can i prevent the group from collapsing ?

    best thanks 
  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2907 posts

    Posted 06 Dec 2018 Link to this post

    Hi Andre,

    You can use the GroupExpanding 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.
  3. Andre
    Andre avatar
    41 posts
    Member since:
    Feb 2018

    Posted 06 Dec 2018 in reply to Dimitar Link to this post

    hi dimitar

    thanks a lot. it works.

    great service !!!

    andre

Back to Top