Hi,
Let me give you a overview of what I am trying to achive.
I have created a Hierarchical grid with 2 level. No I am placing a checkbox at the group level and also checkboxes on each child level.
Now I want to do the following things.
1) Once the checkbox at group level is selected then I want all the child checkbox to be selected.2) I want to read all the values which one is selected both at group level and child level.
I was going through this post but I am not sure where to call the above function. Appriciate your help.
Thanks.
OK. I will check it and let you know.
Thanks Chris.
btw you might wanna test that lol, didn't check and half asleep
function CheckAll(chkAllObject, fieldID) { var fieldCheck = document.getElementsByName(fieldID); if (chkAllObject.checked) { for (i = 0; i < fieldCheck.length; i++) fieldCheck[i].checked = true; } else { for (i = 0; i < fieldCheck.length; i++) fieldCheck[i].checked = false; }}
name all your checkboxes the same (ie: mycheckbox) on your check all checkbox type CheckAll(this, 'mycheckbox');
Hi Aaron
I am trying to do something similar. Can you please post the solution for this?FYI: I am trying to do this on the client side and also currently my check boxes are unbound columns of type check box. But I can change the check box column to a template field if it will make it easier to code.Thanks
Hello as_sinha,
There are a couple of bits of information I would need to detail a solution for you. Once determining which event to listen to, you can retrieve the row associated with the checkbox that was checked.
Once you have the parent row, it will expose its own rows collection. You can then loop through this collection of child rows, check each of the checkboxes, and access the cells of those rows.
My two questions would be: Do you want this to happen on the client or the server? And are you using a Column with its Type set to Checkbox or are you using a TemplatedColumn?
Please let me know and I can give you a more detailed answer. Thank you.