changing mouse cursor over certain DataGrid columns

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
MrNobody,

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.
 
Back
Top