I have an if condition:
if (e.Item.Cells[7].Text == "something")
But how can I first check if cell [7] exists?
Thanks...
You can use the Cells.Count property. If it is greater than 7, then Cells[7] exists (since the index is based on zero).
Cells.Count
Cells[7]
if (e.Item.Cells.Count > 7 && e.Item.Cells[7].Text == "something")