The
CellMouseEnter
event of
DataGridView
control can be used for this purpose as shown below
private void dataGridView1_CellMouseEnter(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0) {
return;
}
var dataGridView = (sender as DataGridView);
if (e.ColumnIndex == 2 && (string)dataGridView.Rows[e.RowIndex].Cells[0].Value=="2")
dataGridView.Cursor = Cursors.WaitCursor;
else
dataGridView.Cursor = Cursors.Hand;
}