We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridGroupingControl. Group auto expanded when caption row is selected

How to prevent Group from expanding when caption row is selected? I only need to expand the Group when +/- PushButton is used

thanks
Dmitry

1 Reply

AD Administrator Syncfusion Team January 4, 2007 04:50 AM UTC

Hi Dmitry ,

To prevent the expanding of the group when the caption row is selected, you need to handle the GroupExpanding event of grid. Here is a code snippet to show this.

private void gridGroupingControl1_GroupExpanding(object sender, GroupEventArgs e)
{
string TableName = e.Group.ParentTableDescriptor.Name;
GridTableControl tc = (sender as GridGroupingControl).GetTableControl(TableName);
Point pt = tc.PointToClient(MousePosition);
GridTableCellStyleInfo style = tc.PointToTableCellStyle(pt);
if( style != null && style.TableCellIdentity != null
&& style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell)
e.Cancel = false;
else
e.Cancel = true;
}

Best Regards.
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon