Question about the Scroll event for a datagrid.

G

Guest

Since the compact framework doesn't support the scroll event for a datagrid.
I would like to know if there is any workaround to capture the scroll event
for a datagrid.

Thanks
Chuck
 
S

Sergey Bogdanov

Actually workaround exists, you can use reflection to retrieve Vertical
ScrollBar & Horizontal ScrollBar private properties but there are no
guarantees that it can't be changed:

VScrollBar vb = (VScrollBar)grid.GetType().GetField("m_sbVert",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(grid);
HScrollBar hb = (HScrollBar)grid.GetType().GetField("m_sbHorz",
BindingFlags.NonPublic|BindingFlags.GetField|BindingFlags.Instance).GetValue(grid);


Best regards,
Sergey Bogdanov
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top