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