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

scroll the ggc to show active row

hi all.
in my ggc i have 20 rows.
when the user expands the last visible grouped row, the row is expanded but i cant see the rows.
how can i set the scroll bar to show all the records?

1 Reply

AD Administrator Syncfusion Team February 26, 2007 09:26 PM UTC

Hi Shachar,

You can handle the GroupExpanded event of the Grid and call the ScrollCellInView method to scroll the expanded record cell into the view. Please find the code snippet below.

private void gridGroupingControl1_GroupExpanded(object sender, GroupEventArgs e)
{
if( e.Group != null && e.Group.Records.Count > 0)
{
Record rec = e.Group.Records[e.Group.Records.Count - 1];
GridTable table = e.Group.ParentTable as GridTable;
int index = table.NestedDisplayElements.IndexOf(rec);
string tName = e.Group.ParentTableDescriptor.Name;
(sender as GridGroupingControl).GetTableControl(tName).UpdateScrollBars();
table.TableModel.ScrollCellInView(GridRangeInfo.Row(index),GridScrollCurrentCellReason.BeginEdit);
}
}

Sample : GGC_Scroll.zip

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon