Hello,
I have a datagridview with scroll bar . I want to track the scroll event but I am not able to catch the scroll event
I tried the datagridview.Scroll but I didnt understand the event
Thank you
Pritha
Loading
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.
Nilanka DharmadasaPosted Jan 28, 2010, 4:51 AM
From that line, you bind 'dataGridView1_Scroll' method to 'Scroll' event of the datagridview. It means, when a user scrolls datagridview, 'dataGridView1_Scroll' method is called. This is how you bind events from code.
If you do not use this line in the code, you can set it from the designer too. If you call this from code, you should call it in the form constructor, after InitializeComponent() method. Do as i have done in my code.
Btw, when you tick your favourite answer, please make sure to tick the answer which actually helped you.
Thanks.
priya kalashiPosted Jan 28, 2010, 4:04 AM
But what exactly is
dataGridView1.Scroll += new ScrollEventHandler(dataGridView1_Scroll);
and where do I need to call it from .
Priya
Nilanka DharmadasaPosted Jan 28, 2010, 3:24 AM
Yes. You can use scroll event for that. If you are not sure how to do that, check my code. It will help you for sure.
If you find this answer useful, please tick 'Do you like this answer' checkbox.
Lalit MPosted Jan 28, 2010, 3:13 AM
Link-1
Link-2
Gaurish KumarPosted Jan 28, 2010, 3:08 AM
If you are working on windows forms
then u can use the onScroll event of the datagridview like that