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

vertical scroll bar not moving to reflect the expanded grid element/section

In our application, we implement the gridgroupingcontrol. When we attempt to expand a section by clicking on the "+", the vertical scroll bar to the right does not move to show the user the new expanded section. The user has to manually scroll the vertical bar down to see the results after clicking the "+". Specifically, when you vertically scroll down the bar the the very bottom of your application, and the last element is a section that is expandable, if the user decides to click the plus sign, the vertical scroll bar won''t move further down all the way so the user can see things.

If you download the zip attached, which is the Hierarchy View sample taken from SyncFusion, this happens as well. Try to run this sample, scroll to the very bottom, and expand "WANDK" by clicking the plus sign. Notice you have to manually move the vertical bar yourself to see the results of the expansion.

What can we do to solve this problem? Is this a fix in later versions, as we are using 5.1.1.47? What is the workaround to get this scroll bar to behave correctly in our current version?

Please let me know! Thanks.



HierarchyView_f1961696.zip

3 Replies

SR Sri Rajan Syncfusion Team June 6, 2008 05:35 AM UTC

Hi Richy,

Thank you for your interest in Syncfusion products.

You need to handle GroupExpanded event and call ScrollCellInView method to scroll the expanded record cell into the view. Please refer the below code for more details.

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);
}
}


Here is the minimal sample which implements this task.
http://websamples.syncfusion.com/samples/grid.windows/I46897/main.htm

Please let me know if this helps.

Best Regards,
Srirajan



RL Ricky Ling June 9, 2008 03:00 PM UTC

Our grid has records inside, so I am handling the OnRecordExpanded event, as opposed to the OnGroupExpanded. I have found a method which am I using now called ScrollInView(rec) which takes in a record and scrolls it into view. My implementation locates the last record and scrolls it so that it is visible to the user. However, we want to handle the case where if the user clicks on the '+' to expand the record, and if there are say 200 rows resulting, instead of showing the last 200th row, or somewhere in the middle, make the top row sit at the very top and show as much as possible regardless of whether the last rows can be seen.

Any suggestions on how to approach this case?

Thanks.



SR Sri Rajan Syncfusion Team June 10, 2008 03:48 AM UTC

Hi Ricky,

Your Direct-Trac incident 46958 is updated. Please follow up the incident for this query.

Best Regards,
Srirajan.


Loader.
Live Chat Icon For mobile
Up arrow icon