Hiearchial representation in Grid
-
Hello guys,
I have a particular scenario to display hierarchial information in grid. Consider the following table structure and the sample data.Table structure
ObjectId - Primarykey
Parentid
descriptionSample data
objectid parentid description
1 null Parent 1
2 1 child for p1
3 1 child for p1
4 null Parent 2
5 4 child for p4
6 5 child for c5
7 6 child for c6So, from the above data, objects 1 and 4 have parentid as null. So, they are the base parent objects to be displayed in the grid. Objects 2,3 are child for parent object 1. So object 2 and 3 should be nested within object 2. Similarly object 5 should be nested within parent object 4. Object 6 has the parentid as 5. So it should be nested within the child object 5. Also object 7 should be within object 6. So the nesting can be n levels and all this nesting should be visible inside the grid. The grid row holding the parent object should have a + sign and on click of that + sign, the immediate child objects should be visible, using javascript.
The grid should appear like this
objectid description
-
1 parent 1
objectid description
2 child for p1
3 child for p1 -
4 parent 2
-
objectid description
5 child for p4-
objectid description
6 child for c5- objectid description
7 child for c6
- objectid description
-
-
Please provide a solution. I am working with asp.net 2005,c# and oracle 10g.
Please help me ... its very urgent...
-
-
Hello guys,
I have a particular scenario to display hierarchial information in grid. Consider the following table structure and the sample data.Table structure
ObjectId - Primarykey
Parentid
descriptionSample data
objectid parentid description
1 null Parent 1
2 1 child for p1
3 1 child for p1
4 null Parent 2
5 4 child for p4
6 5 child for c5
7 6 child for c6So, from the above data, objects 1 and 4 have parentid as null. So, they are the base parent objects to be displayed in the grid. Objects 2,3 are child for parent object 1. So object 2 and 3 should be nested within object 2. Similarly object 5 should be nested within parent object 4. Object 6 has the parentid as 5. So it should be nested within the child object 5. Also object 7 should be within object 6. So the nesting can be n levels and all this nesting should be visible inside the grid. The grid row holding the parent object should have a + sign and on click of that + sign, the immediate child objects should be visible, using javascript.
The grid should appear like this
objectid description
-
1 parent 1
objectid description
2 child for p1
3 child for p1 -
4 parent 2
-
objectid description
5 child for p4-
objectid description
6 child for c5- objectid description
7 child for c6
- objectid description
-
-
Please provide a solution. I am working with asp.net 2005,c# and oracle 10g.
Please help me ... its very urgent...
You can do it in TreeView control with the same look and with proper js. You can also do it in datagrid but will have some limitations. Let me know so accordingly I can give you the code.
"Walking on water and developing Software on a specification is easy, if both are frozen..."
-