I am using a UnboundCheckBoxField and binding data on the client using ajax. How do i set/reset the checkbox to default to unchecked?
Hi c_v_nag,
Thank you for sharing your solution with the community.
If you have any other questions, please feel free to contact me.
I was looking for a mechanism where i dont need to parse the rows repeatedly. otherwise that is the use of client binding.
Besides using set_value() results in a checkbox click event getting fired - which is not desirable.
so found a mid level solution: Before i set the datasourse and do databind, i do the following:
var rws = new Array();for (var i = 0; i < gridData.Rows.length; i++) { var rowElem = GetRowFromData(gridData.Rows, i); rowElem.Multi = false; var row = rws.push(rowElem); }
//Multi is the column name for the unbound checkbox column
Hello c_v_nag,
I'm just checking if you have resolved your issue.
You can use something like the followig javascript code to set the values for UnboundCheckBoxField:
var grid = $find("WebDataGrid1");var rowsCount = grid.get_rows().get_length();for (var i = 0; i < rowsCount; i++) { grid.get_rows().get_row(i).get_cellByColumnKey("UnboundField1").set_value(false);}
If you have any questions regarding the mater, please let me know.