End-User Ungrouping

4 posts, 1 answers
  1. Kevin White
    Kevin White avatar
    60 posts
    Member since:
    Jun 2004

    Posted 09 Jun 2011 Link to this post

    Under the newest Telerik controls for Winforms (2011.1.11.419) -- Ungrouping seems to have changed. Instead of being able to drag from the group panel to ungroup - you must hit the "X". My users have a problem with this and would prefer the Drag and Drop Ungrouping feature.

    Was this removed? And if so, is there a workaround I might employ?

    Thanks
  2. Answer
    Jack
    Admin
    Jack avatar
    2335 posts

    Posted 15 Jun 2011 Link to this post

    Hi Kevin White,

    Yes, I confirm the issue. We will correct the behavior in our next version - Q2 2011. You can work around it by using custom rows. Please consider the following code:
    public class MyGroupRow : GridGroupHeaderRowElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(GridGroupHeaderRowElement);
            }
        }
     
        protected override bool ProcessDragOver(Point currentMouseLocation, ISupportDrag dragObject)
        {
            GroupFieldDragDropContext dataContext = dragObject.GetDataContext() as GroupFieldDragDropContext;
            if (dataContext != null)
            {
                return true;
            }
            return base.ProcessDragOver(currentMouseLocation, dragObject);
        }
     
        protected override void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
        {
            GroupFieldDragDropContext dataContext = dragObject.GetDataContext() as GroupFieldDragDropContext;
            if (dataContext != null)
            {
                dataContext.ViewTemplate.GroupDescriptors.Remove(dataContext.GroupDescription);
                return;
            }
            base.ProcessDragDrop(dropLocation, dragObject);
        }
    }
     
    public class MyDataRow : GridDataRowElement
    {
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(GridDataRowElement);
            }
        }
     
        protected override bool ProcessDragOver(Point currentMouseLocation, ISupportDrag dragObject)
        {
            GroupFieldDragDropContext dataContext = dragObject.GetDataContext() as GroupFieldDragDropContext;
            if (dataContext != null)
            {
                return true;
            }
            return base.ProcessDragOver(currentMouseLocation, dragObject);
        }
     
        protected override void ProcessDragDrop(Point dropLocation, ISupportDrag dragObject)
        {
            GroupFieldDragDropContext dataContext = dragObject.GetDataContext() as GroupFieldDragDropContext;
            if (dataContext != null)
            {
                dataContext.ViewTemplate.GroupDescriptors.Remove(dataContext.GroupDescription);
                return;
            }
            base.ProcessDragDrop(dropLocation, dragObject);
        }
    }

    You should handle the CreateRow event to replace the rows:
    void radGridView1_CreateRow(object sender, GridViewCreateRowEventArgs e)
    {
        if (e.RowInfo is GridViewDataRowInfo)
        {
            e.RowType = typeof(MyDataRow);
        }
        if (e.RowInfo is GridViewGroupRowInfo)
        {
            e.RowType = typeof(MyGroupRow);
        }
    }

    I updated your Telerik points for reporting this issue. Should you have any further questions, do not hesitate to contact me.

    Kind regards,
    Jack
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kevin White
    Kevin White avatar
    60 posts
    Member since:
    Jun 2004

    Posted 20 Jun 2011 Link to this post

    Thank you, this works well.

    Any estimate on a release date for this fix?
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 23 Jun 2011 Link to this post

    Hi Kevin,

    Our next release is scheduled for July, however, I am not able to provide you with exact date. If you have other questions, do not hesitate to ask.
     
    Greetings,
    Jack
    the Telerik team
    Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Back to Top