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.
Unfortunately, activation email could not send to your email. Please try again.

set a grouped row in ggc

Thread ID:

Created:

Updated:

Platform:

Replies:

58239 Mar 21,2007 03:52 AM Mar 21,2007 12:59 PM Windows Forms 2
loading
Tags: GridControl
Shachar Shimshon
Asked On March 21, 2007 03:52 AM

hi all.
in my ggc i have some rows, grouped by one column.
when the user clicks on a button i want to expand a specific group (e.g - the parentgroup.category=5)
and set its first row to be selected.
can you give me a small example for this?

Administrator [Syncfusion]
Replied On March 21, 2007 10:55 AM

Hi Shachar,

Try handling the GroupExpanded event of the grid and call the SetSelected method to select the first child records in a group. Here is a code snippet.

private void gridGroupingControl1_GroupExpanded(object sender, GroupEventArgs e)
{
if( e.Group != null && e.Group.Records.Count > 0)
{
e.Group.Records[0].SetSelected(true);
e.Group.Records[0].SetCurrent(e.Group.Name);
}
}

Best regards,
Haneef

Shachar Shimshon
Replied On March 21, 2007 12:59 PM

but i want my user to expand the group.
how can it happen with the event?
my user would like to expans a ceratin group that he knows it's category, so how can he do it?

>Hi Shachar,

Try handling the GroupExpanded event of the grid and call the SetSelected method to select the first child records in a group. Here is a code snippet.

private void gridGroupingControl1_GroupExpanded(object sender, GroupEventArgs e)
{
if( e.Group != null && e.Group.Records.Count > 0)
{
e.Group.Records[0].SetSelected(true);
e.Group.Records[0].SetCurrent(e.Group.Name);
}
}

Best regards,
Haneef

CONFIRMATION

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.

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.

;