Message: 'childNodes.length' is null or not an object


i have a function
function GridAllCheck(Grid_Name)
{
var G_View = document.getElementById(Grid_Name).id;

alert(G_View);//- here i am getting the gridview id

for(var child1 = 0; child1 <= G_View.childNodes.length-1;child1++)
{
var G_Child1 = G_View.childNodes(child1);
for(var child2 = 0; child2 <= G_Child1.childNodes.length-1;child2++)
{

}
}
}
}

i have multiple grids