How to prevent a caption row in a ggc from expanding the group when a cell in that row receives focus

i have a ggc with one level of grouping; when i use the arror key and navigate to the caption row, the group expands if it is collapse.

How can i prevent this and only allow user to expand the group by click the plus/minus button.

1 Reply

AD Administrator Syncfusion Team December 7, 2006 05:33 AM UTC

Hi James,

You can handle TableControlCellButtonClicked event to set the IsClickExpand flag( sClickExpand = true;) and check this falg to expand the group in the GroupExpanding event of the grid. Here is a code snippet to show this.

bool IsClickExpand = false;
private void gridGroupingControl1_TableControlCellButtonClicked(object sender, GridTableControlCellButtonClickedEventArgs e)
{
GridTableCellStyleInfo style = e.TableControl.Model[e.Inner.RowIndex,e.Inner.ColIndex] as GridTableCellStyleInfo;
if( style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionPlusMinusCell)
IsClickExpand = true;
}

private void gridGroupingControl1_GroupExpanding(object sender, GroupEventArgs e)
{
if(IsClickExpand)
IsClickExpand = false;
else
e.Cancel = true;
}

Best Regards,
Haneef

Best Regards,
Haneef

Loader.
Up arrow icon