When handing the DataGridView.Scroll
event, you can check whether it was the end of the scroll (when dragging the scroll bar with the mouse, this is presumably when the mouse button is released).
The problem is that this never seems to happen. e.Type
is never ScrollEventType.EndScroll
What's wrong with this? How can I do something only when scrolling finishes?
private void dataGridView_Scroll(object sender, ScrollEventArgs e)
{
if (e.Type == ScrollEventType.EndScroll)
{
// ...
}
}
Well, it seems that this event is just bugged.
You can latch on the the DGV's private scroll bar objects (via reflection) and handle their events, where ScrollEventType.EndScroll
appears as expected.
See this this link for how to do it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With