I’ve table in database ItemList that hold ProdutID with ItemID.
ProductID ItemID
AAA 1001
AAA 1002
AAA 1003
BBB 1201
BBB 1293
CCC 1040
DDD 2011
DDD 3203
I want add all those data to Treeview Like this:
+AAA
- 1001
- 1002
- 1003
+BBB
- 1201
- 1293
+CCC
- 1040
+DDD
- 2011
- 3203
please teach me how to do this. Thanks.
edit :
i try to add each item into ArrayList with length 2 data (ProductID, ItemID)
for(int i=0;i<arrayList.count;i++)
{
TreeNode treeNode = new TreeNode(((string[])arrayList[i])[0]);
treeview1.Nodes.Add(treeNode);
}
You would do this dynamically using two for loops