I have an unbound checkbox on the grid and based on a number of conditions I want to enable or disable the checkbox for that row. I think I need to run this during the InitializeRow event for the grid, but I'm not sure how to reference the unbound checkbox on the grid.
How do I reference the checkbox during the InitializeRow event?
Hello,
You can select the row from the event args of row initialize event and select the checkbox column based on index or a key by using the Items property.
protected void WebDataGrid1_OnInitializeRow(object sender, RowEventArgs e) { var checkbox = e.Row.Items.FindItemByKey("IsSelected"); checkbox.Value = true; }
I have attached sample for reference.
Let me know if I may be of further assistance.
I think that is very close to what I'm looking for. I have a bunch of conditions I'm looking at to enable or disable the checkbox. Is there an "enabled" or "visible" property I can use to disable the checkbox?