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
close icon

Expand functionality in Grouping grid

Hi, Can I do expand of only the selcted grouped rows in a grouping grid..? If I use Groupinggrid.Table.ExpandAllGroups(); It expands all the grouped rows. I want to expand only highlighted or selected grouped row.Is there any method to do this..? Thx in advance, Prathima

4 Replies

AD Administrator Syncfusion Team May 17, 2005 10:39 AM UTC

Given a Group g, you can expand or collapse it by setting g.IsExpanded to true or false. Same is true for a GridRecord r using r.IsExpanded. (You can also use teh Record.SetSelected method too.) Here is a little button handler that will expand all selected records in a nested table.
private void button1_Click(object sender, System.EventArgs e)
{
	this.gridGroupingControl1.Table.CollapseAllRecords();
	foreach(SelectedRecord r in this.gridGroupingControl1.Table.SelectedRecords)
	{
		r.Record.IsExpanded = true;
	}
}


PV Prathima Venkobachar May 18, 2005 05:58 AM UTC

Thx for the reply. I have 10 grouped rows.I hv expanded 3 grouped rows.I have selected the record in the first grouped row.Now if I click expangOnlySelected group, I get selectedrecords count zero. I assume selected reocrd is nothing but selected row inside a grouped row. Thx, prathima >Given a Group g, you can expand or collapse it by setting g.IsExpanded to true or false. Same is true for a GridRecord r using r.IsExpanded. (You can also use teh Record.SetSelected method too.) > >Here is a little button handler that will expand all selected records in a nested table. >
>private void button1_Click(object sender, System.EventArgs e)
>{
>	this.gridGroupingControl1.Table.CollapseAllRecords();
>	foreach(SelectedRecord r in this.gridGroupingControl1.Table.SelectedRecords)
>	{
>		r.Record.IsExpanded = true;
>	}
>}
>
> >


AD Administrator Syncfusion Team May 18, 2005 07:49 AM UTC

I do not know what ''expangOnlySelected'' is. To use gridGroupingControl1.Table.SelectedRecords, make sure you have set: this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One;//something other than None.


PV Prathima Venkobachar May 18, 2005 08:50 AM UTC

''expangOnlySelected'' is a btn I hv in the form. Onclick of this, I shd expand only one grouped row which is selected. still I get gridGroupingControl1.Table.SelectedRecords count zero. >I do not know what ''expangOnlySelected'' is. > >To use gridGroupingControl1.Table.SelectedRecords, make sure you have set: > >this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; >this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One;//something other than None. >

Loader.
Live Chat Icon For mobile
Up arrow icon