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
description
Sample 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 c6
So, 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...