I have a WebDataGrid that contains an ItemTemplate with one checkbox. The user can select any number of checkboxes and click on a button to save their selections. In the button's click event, I am attempting to loop through each row in my grid to determine which checkbox was selected. Everytime I try and find the checkbox control, it returns a null. I have tried the same thing in the InitializeRow event of the grid and I am able to find the control. What is wrong?
protected void btnDelete_Click(object sender, EventArgs e) {
foreach (GridRecord gridRow in gridBrokerRelationships.Rows) { CheckBox chk = (CheckBox)gridRow.Items[gridBrokerRelationships.Columns["Delete"].Index].FindControl("chkDel");
if (chk != null) { if (chk.Checked) { } } }
}
Hi,
There was an issue that was exhibiting this behavior around the timeframe of the post. Since then the issue has been fixed. I would recommend upgrading to the latest Service Release to resolve this.