protected void grdOpenItems_PreRender(object sender, EventArgs e) { foreach (GridViewRow row in grdOpenItems.Rows) { if (row.RowType == DataControlRowType.DataRow) { HyperLink hl = (HyperLink)row.Cells[9].Controls[0]; // 9 is the hyperlink column index if (hl.Text = "Reserved") { hl.Enabled = false; } if (hl.Text = "Available") { hl.Enabled = true; } } } }This does not work because the Controls collection is empty. The following does not generate an error but it doesn't disable the link or the column, either:
protected void grdOpenItems_PreRender(object sender, EventArgs e) { foreach (GridViewRow row in grdOpenItems.Rows) { if (row.RowType == DataControlRowType.DataRow) { string sCategory = row.Cells[9].Text; if (sCategory == "C" || sCategory == "E") { row.Cells[9].Enabled = false; } else { row.Cells[9].Enabled = true; } } } }So close. . . Any suggestions as to what to try next?