I have GridView two column, 1 column is RadioButton and other is Checkbox,
I want based on RadioButton click in the same row checkbox should be checked or unchecked, in the following code if click radio button then all checkbox in the columns is checked.
<script type="text/javascript">
function Check_Radio(rb) {
var isChecked = rb.checked;
var row = rb.parentNode.parentNode;
if (isChecked) {
row.style.backgroundColor = '#B6C4DE';
row.style.color = 'black';
}
var currentRdbID = rb.id;
parent = document.getElementById("<%= GridView1.ClientID %>");
var items = parent.getElementsByTagName('input');
for (i = 0; i < items.length; i++) {
if (items[i].id != currentRdbID && items[i].type == "radio") {
if (items[i].checked) {
items[i].checked = false;
items[i].parentNode.parentNode.style.backgroundColor = 'white';
items[i].parentNode.parentNode.style.color = '#696969';
}
}
if (items[i].id != currentRdbID && items[i].type == "checkbox") {
items[i].checked = true;
}
}
}
</script>
How can be fix the problem..
Thanks