I use a webdatagrid in which i have templated check boxes. On postback, the webdatagrid does not reflect any of the checking/unchecking done on the client side, but reverts to values from the initial load. How can I get my code behind to pick up the client side changes? I'm using IE7.
Protected Sub btnSubmitgrid_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmitgrid.Click
For iCount As Integer = 0 To WebDataGrid1.Rows.Count - 1
Dim cb As CheckBox = CType(WebDataGrid1.Rows(iCount).Items.FindItemByKey("x").FindControl("cbSelect"), CheckBox) Dim cb1 As CheckBox = CType(WebDataGrid1.Rows(iCount).Items.FindItemByKey("y").FindControl("cbTake"), CheckBox) Dim cb2 As CheckBox = CType(WebDataGrid1.Rows(iCount).Items.FindItemByKey("z").FindControl("cbDelete"), CheckBox)
Next
End Sub
Hello,
please find attached a sample of a Webdatagrid, where you can see that the state of the checkboxes persists on postback, which is the default behavior of the grid. Please test this sample on your side and let me know if you're able to reproduce the issue with it.
If you have further questions, please don't hesitate to ask.
I am still following your case. Have you been able to resolve the issue?If you have any concerns or questions, please feel free to contact me, I will be glad to help you.
Yes, I resolved the issue by rebuilding. I don't know why it didn't work but it works now. Thanks.
thank you for the feedback. If you have additional questions don't hesitate to ask.