i am using hierarchy rad grid. In radgrid_itemcreated event i am checking if the griddata item is in the parent grid or in the child grid. How to i get the row index of parent grid in a child grid ?
I have hierarchy rad grid and checkboxes associated with each grid data row. if i select the top grid all child grid rows should be selected. if i select middle grid then the last grid rows should be selected.if i deselect any row in the child grid the parent rows should also be deselected.
i have my code where if i select top grid all child rows are selected. how can i achieve the same with the middle grid in the hierarchy.
function CheckBoxPackage_OnClick(obj, index) {
var grid = $find("<%= RadGrid1.ClientID%>");
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[index];
var detailView1 = row.get_nestedViews()[0];
for (var i = 0; i < detailView1.get_dataItems().length; i++) {
var cbOrder = detailView1.get_dataItems()[i].findElement("CheckBoxOrder");
cbOrder.checked = obj.checked;
for (var j = 0; j < detailView1.get_dataItems()[i].get_nestedViews()[0].get_dataItems().length; j++) {
var checkBox3 = detailView1.get_dataItems()[i].get_nestedViews()[0].get_dataItems()[j].findElement("CheckBoxOrderLine");
checkBox3.checked = obj.checked;
}
}
document.getElementById("<%= btnAssignCodes.ClientID%>").disabled = false;
}
In the above code if top checkbox in the 3 levels of grid is selected all child are selected but if 2nd level grid checkbox is selected then 3rd level grid rows are not selected. please suggest .
thanks
I have hierarchy rad grid and checkboxes associated with each grid data row. if i select the top grid all child grid rows should be selected. if i select middle grid then the last grid rows should be selected.if i deselect any row in the child grid the parent rows should also be deselected.
i have my code where if i select top grid all child rows are selected. how can i achieve the same with the middle grid in the hierarchy.
function CheckBoxPackage_OnClick(obj, index) {
var grid = $find("<%= RadGrid1.ClientID%>");
var MasterTable = grid.get_masterTableView();
var row = MasterTable.get_dataItems()[index];
var detailView1 = row.get_nestedViews()[0];
for (var i = 0; i < detailView1.get_dataItems().length; i++) {
var cbOrder = detailView1.get_dataItems()[i].findElement("CheckBoxOrder");
cbOrder.checked = obj.checked;
for (var j = 0; j < detailView1.get_dataItems()[i].get_nestedViews()[0].get_dataItems().length; j++) {
var checkBox3 = detailView1.get_dataItems()[i].get_nestedViews()[0].get_dataItems()[j].findElement("CheckBoxOrderLine");
checkBox3.checked = obj.checked;
}
}
document.getElementById("<%= btnAssignCodes.ClientID%>").disabled = false;
}
In the above code if top checkbox in the 3 levels of grid is selected all child are selected but if 2nd level grid checkbox is selected then 3rd level grid rows are not selected. please suggest .
thanks