Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Treeview Control Populating Problem

I am trying to populate a Treeview control with parent Plans and their
child Groups. I wrote code that should generate the following:

Plan 1
==Group 1
==Group 2
Plan 2
==Group 1
==Group 2
==Group 3
==Group 4
Plan 3
==Group 1
==Group 2
==Group 3
==Group 4
==Group 5

When the code runs, I only see the following in the treeview:

Plan 1
==Group 1
==Group 2
Plan 2
==Group 3
==Group 4
Plan 3
==Group 5

Here is my code. The variable "UBound(gPlanData(i).Group)" is 2, 4, 5
for each plan.

With Me.tvPlanGroup
For i = 1 To 3
Set nodX = .Nodes.Add(, , "Plan " & i, gPlanData(i).Name)
Set nodX = Nothing
y = UBound(gPlanData(i).Group)
For j = 1 To y
Set nodX = .Nodes.Add("Plan " & i, tvwChild, _
"Group " & j,
gPlanData(i).Group(j).Name)
nodX.EnsureVisible
Set nodX = Nothing
Next j
Next i
End With

If there are fewer groups for each subsequent plan, they don't show up
in the tree. This in code:
Plan 1
==Group 1
==Group 2
Plan 2
==Group 1
==Group 2
Plan 3
==Group 1
==Group 2

Shows in my tree as this:
Plan 1
==Group 1
==Group 2
Plan 2
Plan 3

Please help me figure out why this is behaving this way. Thanks in
advance, Erika.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Treeview Control Populating Problem

I figured it out. I had the same Key for my group names, so only new,
unique groups were showing.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with control tag and populating speadsheet antonsaitz Excel Discussion (Misc queries) 0 June 30th 06 04:29 PM
Treeview Control Manfred Senn Excel Programming 4 May 12th 05 08:40 PM
Need help with Treeview control ?? Dan Thompson Excel Programming 5 December 9th 04 10:54 PM
Treeview Control populating Joe O. Excel Programming 2 May 5th 04 01:04 PM
TreeView Control Andy Excel Programming 0 January 28th 04 12:01 PM


All times are GMT +1. The time now is 10:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"