1: 2: 3: 4: 5: 6: 7: 8:
if (e.Row.RowType == DataControlRowType.DataRow) { Button btn = (Button)e.Row.FindControl("InactiveBTN"); if (e.Row.DataItem["Status"] == "Inactive") { Button btn = ((Button)(e.Row.Cells[3].Controls[1])); btn.Text = "Activate";