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.

scroll the ggc to show active row

Thread ID:

Created:

Updated:

Platform:

Replies:

57090 Feb 26,2007 07:42 AM Feb 26,2007 04:26 PM Windows Forms 1
loading
Tags: GridControl
Shachar Shimshon
Asked On February 26, 2007 07:42 AM

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?

Administrator [Syncfusion]
Replied On February 26, 2007 04:26 PM

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

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.

;