AD
Administrator
Syncfusion Team
October 21, 2005 12:27 PM UTC
The grid uses a mouse controller architecture to control cursors. There are two ways you can change the cursor. One is to implement your own mouse controller, and the other is to derive the grid, and override OnSetCursor. Here is a forum thread that has samples for both techniques.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=8551
AD
Administrator
Syncfusion Team
October 21, 2005 12:44 PM UTC
Another way to handle this is to use a custom cell type that controls the cursor over teh column. The 3.3.0.0\Windows\Grid.Windows\Samples\In Depth\DerivedCellControlTutorial sample that is discussed in the user''s guide changes the cursor over links. You could try something similar.
IJ
Iain Jolly
October 21, 2005 01:53 PM UTC
Thanks for the fast response. I am still having problems though as I can''t get it to work. The event is definately handled but the cursor does not change.
Thanks
Iain
private void dgInvoicesMain_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
int row; //row that the mouse is currently over.
int col; //column that the mouse is currently over.
//Get the row, column point where the users mouse is and process.
if
(dgInvoicesMain.PointToRowCol(new System.Drawing.Point(e.X,e.Y),out row,out col))
{
if(col==2)
{
this.Cursor = Cursors.Hand; }
}
}
AD
Administrator
Syncfusion Team
October 21, 2005 02:20 PM UTC
Handling mousemove in the grid was not one of the suggested methods. That will not work.
You will have to use one of the three techniques suggested above to change the cursor in a grid.
IJ
Iain Jolly
October 21, 2005 02:46 PM UTC
Sorry....I have the correct code now. Rushing to meet a deadline and didn''t read the answer.
Thanks for the help.
Works a treat.