protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { ItemGrid.DataSource = _reservationDAO.GetItems(); ItemGrid.DataBind(); foreach (GridViewRow r in ItemGrid.Rows) { string name = r.Cells[1].Text; if (_reservationDAO.GetItemByName(name).Available == false) { CheckBox chBox = r.FindControl("Available") as CheckBox; chBox.Checked = false; } } } }
protected void Page_Load(object sender, EventArgs e) { ItemGrid.DataSource = _reservationDAO.GetItems(); ItemGrid.DataBind(); }