I have a radGridView, the user inserts rows, i want to highlight the cell with null values. For example to make the back color of the cell Red.
I have tried the below code, but it did not work…
Inside a button
for (int j = 0; j < radGridView1.Rows.Count; j++)
{
if (radGridView1.Rows[j].Cells[4].Value.ToString() == "")
radGridView1.Rows[j].Cells[4].Style.ForeColor = Color.Red;
}
So how to do it? or if there is a better highlight method that notifies the user for the empty cell.
Thanks in advance
Fadddd,
I’ll keep it clean and to the point:
03Usr’s answer is talking about a row, you want individual cells
CyberDude’s answer doesn’t take into account the many events that Telerik’s DGV has to modify appearance and functionality
With that said, your code seems to want to highlight empty values (null does not equal empty):