I have this code which will write the status based on respective values. e.x. if AT should write Attended, CO confirmed and any other value should write Open. The problem is it always write Open even if the value of the row is AT. I also tried if then else if else statement and got the same results.
for (int i = 0; i < rowcount; i++)
row = GridView1.Rows[i];
phcd = ((Label)(GridView1.Rows[i].FindControl("lblDcode"))).Text;
tCode = ((Label)(GridView1.Rows[i].FindControl("lblDcode")));
tCode.Text = "Attended";
tCode.Text = "Confirmed";
tCode.Text = "Open";