changing mouse cursor over certain DataGrid columns



How can I customize DataGrid so that when the mouse hovers over certain
columns the cursor changes to the Cursors.Hand cusror? I was unable to use
the MouseEnter/MouseLeave events on DataGrid itself because those events do
not use the MouseEventArgs, so I can't get the X Y position to determine if
the cursor should change for that column



Nicholas Paldino [.NET/C# MVP]


Use the MouseMove event handler. This will give you the X and Y
coordinates of the mouse in relation to the grid.. Once you have those, you
can call HitTest to determine which cell it is over. With that information,
you can set the cursor.

Hope this helps.

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