I have a TemplateDataField within my Grid, which contains a single control as checkbox.
On certain user actions, I wish to loop through the grid and check all of the checkboxes contained within the TemplateDataField's.
I am having difficulty doing this, as it seems that when Virtual Scrolling is used, controls are rendered to the page in batches (based on the grid size, but in my case it is 49), so within my loop, FindControl is actually throwing an error.
Here is my loop:
for (int i = 0; i < webdgRequest.Rows.Count; i++) { var checkBox = (CheckBox) webdgRequest.Rows[i].Items[1].FindControl("checkervalue"); if (checkBox.Enabled && checkBox.Checked == false) { var itemid = (Label) webdgRequest.Rows[i].Items[0].FindControl("lblProcessID"); var command = new SqlCommand("Update ProcessLinks set CheckerValue = 1, CheckerValueUser = '" + HttpContext.Current.User.Identity.Name + "', CheckerValueDate = GETDATE() Where ID = " + itemid.Text); ExecuteStatement(command); } }
Does anyone know of a work around? This grid displays upto 4,000 records, so I really want to avoid turning off Virtual Scrolling if possible.
Kind Regards
Hello meterialized,
This issue with the Virtual Scrolling and the Templated column is fixed in the latest service release.
Please let me know if you have further questions.
Was this question not detailed enough? Or is this functionaility simply out of scope for this control?
The answer to this question will be the deciding factor in my organisations purchase of the controls. If this is not possible, I cannot reccomend purchasing these controls and we shall go with the Telerik RadGrid