int value = Datagridviewcourse.Columns["Course"].Index; { if (value == 2) { e.CellStyle.BackColor = Color.Plum; e.CellStyle.ForeColor = Color.Red; } }
int value1 = Datagridviewcourse.rows["REO"].index { if (value1 == 2) { e.CellStyle.BackColor = Color.blue; e.CellStyle.ForeColor = Color.black; } }
The best overloaded method match for 'System.Windows.Forms.DataGridViewRowCollection.this[int]' has some invalid arguments Argument '1': cannot convert from 'string' to 'int' the above two error shows in int value1 = Datagridviewcourse.rows["REO"].index(this line)
int value1 = Datagridviewcourse.rows["REO"].index
int value1 = Datagridviewcourse.rows[0].index
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)