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

End-User Ungrouping

3 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kevin White
Top achievements
Rank 2
Kevin White asked on 09 Jun 2011, 01:51 PM
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

3 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 15 Jun 2011, 08:00 AM
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.
0
Kevin White
Top achievements
Rank 2
answered on 20 Jun 2011, 03:09 PM
Thank you, this works well.

Any estimate on a release date for this fix?
0
Jack
Telerik team
answered on 23 Jun 2011, 12:32 PM
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.
Tags
GridView
Asked by
Kevin White
Top achievements
Rank 2
Answers by
Jack
Telerik team
Kevin White
Top achievements
Rank 2
Share this question
or