Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Task Panel
  New Posts New Posts RSS Feed - Adding / Removing Groups at Run Time
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Adding / Removing Groups at Run Time

 Post Reply Post Reply
Author
Message
dexatron View Drop Down
Newbie
Newbie
Avatar

Joined: 27 January 2010
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote dexatron Quote  Post ReplyReply Direct Link To This Post Topic: Adding / Removing Groups at Run Time
    Posted: 01 February 2010 at 7:25pm
Hi,
 
I am adding new group with items based on what item is clicked in my top group.
 
I am trying to remove this dynamic group before adding the new group if a different item is clicked on.
 
My problem is that I can seem to remove the existing group.  I can't seem to identify it:
 
'this code fails
If tp1.Groups.Find(2) Then
  tp1.Groups.Remove (tp1.Groups(2))
End If
 
' this is the add code on item click that works fine
 
Set group = tp1.Groups.Add(2, "My Calendar")
group.Items.Add 1, "Weigh In", xtpTaskItemTypeLink, 0
 
thanks for any help
Back to Top
dexatron View Drop Down
Newbie
Newbie
Avatar

Joined: 27 January 2010
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote dexatron Quote  Post ReplyReply Direct Link To This Post Posted: 02 February 2010 at 9:08am
There has to be a better way, but this is how I have it working at the moment:
 
If Item.Group.Id = 1 Then
  If tp1.Groups.Count > 2 Then   ' remove the dynamic group if it exists
    tp1.Groups.Remove (tp1.Groups.Count)
  End If
 
  Select Case (Item.Index - 1)
  
  Case 0
    Set Group = tp1.Groups.Add(2, "My Calendar")
    Group.Items.Add 1, "Weigh In", xtpTaskItemTypeLink, 0
  Case 1....
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.