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. How to make a hierarchy tabler?

How to make a hierarchy tabler?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
5 Posts 3 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.
  • M Offline
    M Offline
    meki_2118
    wrote on last edited by
    #1

    Hi, I'm trying to make a hierarchy table by using the repeater. I've created a loop that checked the items in my data base one-by-one if they have sub items so that they can be placed underneath the main item just like a hierarchy form. But when I tried to insert the item into the repeater one-by-one I encountered a error saying. "ITEM_NAME is neither a DataColumn nor a DataRelation for table Table." Can you teach me how to make a much more easier way to arrange my items in a hierarchy form? thanks.

    C B 2 Replies Last reply
    0
    • M meki_2118

      Hi, I'm trying to make a hierarchy table by using the repeater. I've created a loop that checked the items in my data base one-by-one if they have sub items so that they can be placed underneath the main item just like a hierarchy form. But when I tried to insert the item into the repeater one-by-one I encountered a error saying. "ITEM_NAME is neither a DataColumn nor a DataRelation for table Table." Can you teach me how to make a much more easier way to arrange my items in a hierarchy form? thanks.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      meki_2118 wrote:

      "ITEM_NAME is neither a DataColumn nor a DataRelation for table Table."

      No-one can solve this without seeing the code. A heirarchical table is going to involve nested repeaters. Do you have a fixed depth your heirarchy can go to ? Then you can just set up your data and databind.

      Christian Graus Driven to the arms of OSX by Vista.

      M 1 Reply Last reply
      0
      • M meki_2118

        Hi, I'm trying to make a hierarchy table by using the repeater. I've created a loop that checked the items in my data base one-by-one if they have sub items so that they can be placed underneath the main item just like a hierarchy form. But when I tried to insert the item into the repeater one-by-one I encountered a error saying. "ITEM_NAME is neither a DataColumn nor a DataRelation for table Table." Can you teach me how to make a much more easier way to arrange my items in a hierarchy form? thanks.

        B Offline
        B Offline
        Brij
        wrote on last edited by
        #3

        Can you provide your code?

        Cheers!! Brij

        M 1 Reply Last reply
        0
        • C Christian Graus

          meki_2118 wrote:

          "ITEM_NAME is neither a DataColumn nor a DataRelation for table Table."

          No-one can solve this without seeing the code. A heirarchical table is going to involve nested repeaters. Do you have a fixed depth your heirarchy can go to ? Then you can just set up your data and databind.

          Christian Graus Driven to the arms of OSX by Vista.

          M Offline
          M Offline
          meki_2118
          wrote on last edited by
          #4

          DS = DAL.Get_Data_BE(txtCcNo.Text)
          n = DS.Tables(0).Rows.Count
          Do Until n <= 0
          i = i + 1
          contItemName = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - i).Item("ITEM_NAME")
          contPCode = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - i).Item("P_CODE")
          DS = DAL.Get_Level_BE(contPCode)
          j = DS.Tables(0).Rows.Count
          k = 0
          Do Until j <= 0
          k = k + 1
          PrimCont = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - k).Item("PRIM_KEY")
          DSL = DAL.Get_ItemName_BE(PrimCont)
          ItemCont = DSL.Tables(0).Rows(DS.Tables(0).Rows.Count() = 0).Item("ITEM_NAME")
          ItemRepeater.DataSource = DS
          j = j - 1
          Loop
          DS = DAL.Get_Data_BE(txtCcNo.Text)
          ItemRepeater.DataBind()
          n = n - 1
          Loop

          Here's the loop that I've created. And the hierarchy will consist of up to 5 sub items. that's what I've been planning.

          1 Reply Last reply
          0
          • B Brij

            Can you provide your code?

            Cheers!! Brij

            M Offline
            M Offline
            meki_2118
            wrote on last edited by
            #5

            DS = DAL.Get_Data_BE(txtCcNo.Text) n = DS.Tables(0).Rows.Count Do Until n <= 0 i = i + 1 contItemName = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - i).Item("ITEM_NAME") contPCode = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - i).Item("P_CODE") DS = DAL.Get_Level_BE(contPCode) j = DS.Tables(0).Rows.Count k = 0 Do Until j <= 0 k = k + 1 PrimCont = DS.Tables(0).Rows(DS.Tables(0).Rows.Count() - k).Item("PRIM_KEY") DSL = DAL.Get_ItemName_BE(PrimCont) ItemCont = DSL.Tables(0).Rows(DS.Tables(0).Rows.Count() = 0).Item("ITEM_NAME") ItemRepeater.DataSource = DS j = j - 1 Loop DS = DAL.Get_Data_BE(txtCcNo.Text) ItemRepeater.DataBind() n = n - 1 Loop Here's the code.

            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