What I have is a datagrid with 7 columns in it. Currently I have it so that if there is a no in cell 7 it colors the name red. What I really need is a way to call out columns 2 -7 if there are any no's it colors the name red. I have tried using the following with no luck keeps giving me blue underlines ander the range numbers. How can I call our columns 2 - 7 and color name red if they have a no.
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
If e.Item.Cells.AddRange(2 - 7).Text = "No" Then
e.Item.Cells(0).BackColor = System.Drawing.Color.Tomato
If e.Item.Cells(7).Text = "Yes" Then
e.Item.Cells(0).BackColor = System.Drawing.Color.Green