G
Guest
VS,VB 2005
I have a treeview which i load data into in the forms load event
Adding Nodes and Children to the parent nodes works fine
to add a parent:
Me.tvGroups.Nodes.Add(GroupDataRow(0)("MenuGroupID").ToString,
GroupDataRow(0)("GroupLabel"))
to add a child to a Parent:
ParentIndex =
Me.tvGroups.Nodes.IndexOfKey(GroupDataRow(0)("ParentGroupID").ToString)
NodeRef = Me.tvGroups.Nodes(ParentIndex)
NodeRef.Nodes.Add(GroupDataRow(0)("MenuGroupID").ToString,
GroupDataRow(0)("GroupLabel"))
all works good... but now im trying to add a child to a child and i am
unable to get the parent index by key the same way as above. this code fails
when its a child key im looking for:
ParentIndex =
Me.tvGroups.Nodes.IndexOfKey(GroupDataRow(0)("ParentGroupID").ToString)
suggestions???
I have a treeview which i load data into in the forms load event
Adding Nodes and Children to the parent nodes works fine
to add a parent:
Me.tvGroups.Nodes.Add(GroupDataRow(0)("MenuGroupID").ToString,
GroupDataRow(0)("GroupLabel"))
to add a child to a Parent:
ParentIndex =
Me.tvGroups.Nodes.IndexOfKey(GroupDataRow(0)("ParentGroupID").ToString)
NodeRef = Me.tvGroups.Nodes(ParentIndex)
NodeRef.Nodes.Add(GroupDataRow(0)("MenuGroupID").ToString,
GroupDataRow(0)("GroupLabel"))
all works good... but now im trying to add a child to a child and i am
unable to get the parent index by key the same way as above. this code fails
when its a child key im looking for:
ParentIndex =
Me.tvGroups.Nodes.IndexOfKey(GroupDataRow(0)("ParentGroupID").ToString)
suggestions???