I am writing a form application in C#, and I have a DataGridView, which displays data from SQL server.
These data contain a column called Remove and all rows for this column contain the string Remove. Now I want to make all cells of this column look like a button by changing the background color, and using a hand cursor.
My problem is, I cannot use a hand cursor only on this column. What I want is, when the mouse is over any rows of this Remove column, change the mouse pointer to a hand cursor, but not anywhere else.
for(int i=0; i<myDataGridView.RowCount; i++){
myDataGridView.Cursor = Cursors.Hand;
}
does not do what I want because the mouse pointer becomes the hand cursor everywhere on the DataGridView, rather than only on the Remove column.
I tried something like
for(int i=0; i<myDataGridView.RowCount; i++){
myDataGridView.Columns["Remove"].Cursor = Cursors.Hand;
}
but this gives an error:
System.Windows.Forms.DataGridViewColumn does not contain a definition for "Cursor".
Is there any good way to achieve this? Thank you.