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.

VScrollBar auto-scroll to bottom of GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

95144 Jun 22,2010 07:55 PM Jun 23,2010 04:53 AM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On June 22, 2010 07:55 PM

I have a GridGroupingControl g which is bound to a DataTable.

If g is scrolled to the bottom when a new row is added, I want it to stay scrolled to the bottom. Something like this:



bool wasScrolledToBottom = g.TableControl.VScrollBar.Value == g.TableControl.VScrollBar.Maximum;

// now add a row the the datatable

if (wasScrolledToBottom)
g.TableControl.VScrollBar.Value = g.TableControl.VScrollBar.Maximum;



However, it seems that it is never true that g.TableControl.VScrollBar.Value == g.TableControl.VScrollBar.Maximum.

How can I get this behavior?

Jisha Joy [Syncfusion]
Replied On June 23, 2010 04:53 AM


Hi James,

You could use the TableModel.ScrollCellInView method of GridgroupingControl to stay scrolled to the desired row. See the code:

//now add a row to the datatable

this.gridGroupingControl1.TableModel.ScrollCellInView(GridRangeInfo.Row(this.gridGroupingControl1.TableModel.RowCount), GridScrollCurrentCellReason.Any);

Regards,
Jisha

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.

;