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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

programaticly select a group row

Thread ID:





58319 Mar 22,2007 05:10 AM UTC Mar 22,2007 02:45 PM UTC WinForms 1
Tags: GridControl
Asked On March 22, 2007 05:10 AM UTC

hi all.
how can i programaticly select the group row
(not the records inside the group, but the grouping row itself)

Administrator [Syncfusion]
Replied On March 22, 2007 02:45 PM UTC

Hi Shachar,

You should set the TableOptions.AllowSelection property to GridSelectionFlags.Any; to turn ON cell based selection mechanism in a grid and use TableModel.Selections property to manage the selection in a grid by handling the GroupExpanded event. Please find the code snippet below.

//Form load...
this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.None;
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;

this.gridGroupingControl1.GroupExpanded +=new GroupEventHandler(gridGroupingControl1_GroupExpanded);

private void gridGroupingControl1_GroupExpanded(object sender, GroupEventArgs e)
if( e.Group != null && e.Group.Records.Count > 0)
GridGroupingControl grid = sender as GridGroupingControl;
DisplayElementsInTableCollection elements = e.Group.ParentChildTable.DisplayElements;

int Startindex = elements.IndexOf(e.Group);
int Endindex = elements.IndexOf(e.Group.Records[e.Group.Records.Count -1] );

grid.TableModel.Selections.Add(GridRangeInfo.Rows(Startindex, Endindex));

Best regards,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon