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.Nod es.Add(GroupDat aRow(0)("MenuGr oupID").ToStrin g,
GroupDataRow(0) ("GroupLabel "))
to add a child to a Parent:
ParentIndex =
Me.tvGroups.Nod es.IndexOfKey(G roupDataRow(0)( "ParentGroupID" ).ToString)
NodeRef = Me.tvGroups.Nod es(ParentIndex)
NodeRef.Nodes.A dd(GroupDataRow (0)("MenuGroupI D").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.Nod es.IndexOfKey(G roupDataRow(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.Nod es.Add(GroupDat aRow(0)("MenuGr oupID").ToStrin g,
GroupDataRow(0) ("GroupLabel "))
to add a child to a Parent:
ParentIndex =
Me.tvGroups.Nod es.IndexOfKey(G roupDataRow(0)( "ParentGroupID" ).ToString)
NodeRef = Me.tvGroups.Nod es(ParentIndex)
NodeRef.Nodes.A dd(GroupDataRow (0)("MenuGroupI D").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.Nod es.IndexOfKey(G roupDataRow(0)( "ParentGroupID" ).ToString)
suggestions???
Comment