Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Hiearchial representation in Grid

Hiearchial representation in Grid

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptcssasp-netoracle
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Balji
    wrote on last edited by
    #1

    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

    Please provide a solution. I am working with asp.net 2005,c# and oracle 10g.

    Please help me ... its very urgent...

    V 1 Reply Last reply
    0
    • B Balji

      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

      Please provide a solution. I am working with asp.net 2005,c# and oracle 10g.

      Please help me ... its very urgent...

      V Offline
      V Offline
      Vicky Roberts
      wrote on last edited by
      #2

      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..."

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups