Print Page | Close Window

Item Index Property

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=19428
Printed Date: 26 April 2024 at 5:07pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Item Index Property
Posted By: ManSys
Subject: Item Index Property
Date Posted: 21 January 2012 at 7:12pm
We are using the Task Panel as a menu, separating the menu groups into taskpanel groups.
 
We're letting the user drag items around within the groups but not across groups.  However, we want to be able to save/load the positions of the menu items (taskpanelgroupitems).
 
We've looked at the ItemDrop event but it doesn't seem to fire at the right time. We're using this code to check out the positions, but the same item appears twice, where it was and where it is now;
Private Sub tpMain_ItemDrop(ByVal Item As XtremeTaskPanel.ITaskPanelGroupItem)
   
    Dim tpGroup As TaskPanelGroup
    Dim tpItem As TaskPanelGroupItem
   
    Set tpGroup = Item.Group
    
    For Each tpItem In tpGroup.Items
        Debug.Print tpItem.ID, tpItem.Index, tpItem.Caption
    Next
   
End Sub
Why?  How do we go about saving the positions?


-------------
-
ManSys Limited



Replies:
Posted By: Carlos Rocha
Date Posted: 10 February 2017 at 9:44am
Still not possible with 16.3.1

The solution is:
- Store a reference to the item being dragged within BeginDrag: Set m_ItemDragged = Item
- Use xtpTaskItemAllowDragCopyWithinGroup instead of xtpTaskItemAllowDragMoveWithinGroup
- Inside ItemDrop:

Item.Group.Items.Move m_ItemDragged, Item:Index
Item.Remove
Set m_ItemDragged = Nothing


-------------
SuitePro 20.3.0
OS: Windows 10
Language: Visual Objects 2.8



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net