![]() |
Taskpanel Remove item |
Post Reply ![]() |
Author | |
Woody ![]() Newbie ![]() Joined: 07 July 2004 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() Posted: 12 October 2004 at 3:21pm |
Does anyone have a working example of how to remove a
TaskPanelGroupItem using the Remove method? I'm having to use
Group.Items.Clear, and then add them again, but this is causing
problems and I can't find any documentation.
|
|
![]() |
|
gshawn ![]() Senior Member ![]() Joined: 04 October 2004 Status: Offline Points: 227 |
![]() ![]() ![]() ![]() ![]() |
Hi, I may not be the best person to answer since I've only used the Suite for a couple of hours, but this is one way to remove an item:
That will remove the first item from the first panel. I hope this helps at least a little. |
|
![]() |
|
Woody ![]() Newbie ![]() Joined: 07 July 2004 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Thanks for trying, but that didn't work either.
I thought Remove should work like this: Const ID_TASK_FIND_COMPANY_GROUP1 = 640 Set Group = wndTaskPanel.Groups.Add(ID_TASK_FIND_COMPANY_GROUP1, "Company Search") Set Item = Group.Items.Add(ID_TASK_FIND_COMPANY_ITEM1, "", xtpTaskItemTypeControl) Then: Set Group = wndTaskPanel.Groups.Find(640) Set Item = Group.Items.Remove(1) What am I doing wrong? |
|
![]() |
|
ianp ![]() Moderator Group ![]() ![]() Joined: 19 December 2003 Location: United Kingdom Status: Offline Points: 119 |
![]() ![]() ![]() ![]() ![]() |
Hi Woody You can remove an item using Group.Items.Remove(1) however as it doesn't then return an TaskItem, your code will fail when you try to Set Item = Group.Items.Remove(1) The following code should work if you place it in a form with a taskpanel (wndTaskPanel) and a command button (command1). It will also allow you to specify your ID for the taskitem rather than having to know the Index position...
Edited by ianp |
|
![]() |
|
Woody ![]() Newbie ![]() Joined: 07 July 2004 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
I tried this out and I still get error 'Object doesn't support this property or method'
Using version 9.1, could this be a bug? |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Ianp's code does work.
Try changing to this code, it will let you see the item that is being removed: Set item = group.Items.Add(ID_TASK_FIND_COMPANY_ITEM1, "Some Text", xtpTaskItemTypeText) This is assuming that you want to remove an item within a group and not an entire group. |
|
![]() |
|
Woody ![]() Newbie ![]() Joined: 07 July 2004 Status: Offline Points: 20 |
![]() ![]() ![]() ![]() ![]() |
Shouldn't Private item As XtremeSuiteControls.TaskPanelItem be Private item As XtremeSuiteControls.TaskPanelGroupItem ?
first one isn't recognised, and this may be the problem. |
|
![]() |
|
SuperMario ![]() Admin Group ![]() ![]() Joined: 14 February 2004 Status: Offline Points: 18057 |
![]() ![]() ![]() ![]() ![]() |
Yes you are right, I didn't see that you said you were using 9.1.
TaskPanelItem is an Interface added in 9.5. I would recommend
downloading the latest version if you can.
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |