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.
Syncfusion Feedback

Scrolling with the mouse wheel

Thread ID:

Created:

Updated:

Platform:

Replies:

51813 Nov 14,2006 06:02 PM UTC Nov 16,2006 07:31 PM UTC Windows Forms 1
loading
Tags: Tools
Fady Sayegh
Asked On November 14, 2006 06:02 PM UTC

Hi to all,

i have 2 GridControl, when i scroll in the first i need to do the same with the second.
i made this with the event "VerticalScroll". However when i scroll the GridControl with the mouse wheel the "VerticalScroll" event does not fire and my second GridControl does not scroll.


here the code to scroll when the user click in the vertical scroll bar

if (e.Type == ScrollEventType.EndScroll)
{
// scroll the second grid control
gdc2.ScrollCellInView(gdc2.RowCount, 2);
gdc2.ScrollCellInView(e.NewValue, 2);
}


does anyone has some ideas

Best regards and thanks in advance

Fady sayegh

Administrator [Syncfusion]
Replied On November 16, 2006 07:31 PM UTC

Hi Fady,

We appreciate your kindly patience. This can be achieved by handling the TopRowChanged event and changing the TopRowIndex property of grid 2. Please refer to the following code snippet for details.

>>>>>>>>>>>>>>>><<<<<<<<<<<<
void gridControl1_TopRowChanged(object sender, GridRowColIndexChangedEventArgs e)
{
Synchronize_TopRowChanged(gridControl2, gridControl1, e);
}

void Synchronize_TopRowChanged(GridControl targetGrid, GridControl sourceGrid, GridRowColIndexChangedEventArgs e)
{
if (inTopRowChangedEvent)
return;

inTopRowChangedEvent = true;
try
{
targetGrid.TopRowIndex = sourceGrid.TopRowIndex;
}
finally
{
inTopRowChangedEvent = false;
}
}
>>>>>>>>>>>>>>>><<<<<<<<<<<<

Please refer to the following KB article for more details
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=351

Have a nice time.

Best regards,
Madhan

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.

Warning Icon 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.Close Icon

;