how to link the scrool bars of two grinds on 1 form?
I have 2 data grids on 1 form and i want to link scroll of both the grids . Means if i scroll one grid then automatically the other grid scroll bar also scrolls
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Aug 22, 2009, 2:30 PM
dont forget to mark "Do you like answer" it will give me some credits :)
I have taken here two dataGridView When i Scroll dataGridView1 it will also Scroll DataGridView2 's Scrollbar :)
private void dataGridView1_Scroll(object sender, ScrollEventArgs e)
{
//Check if it is Vertical Scroll
if (e.ScrollOrientation == ScrollOrientation.VerticalScroll)
{
// Set Scrolling Row Index to Scroll Event new Value
dataGridView2.FirstDisplayedScrollingRowIndex = e.NewValue;
}
//You Will Get What you want
}