SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    drag and drop problem

    i am having trouble dragging and dropping an item in a treeview. here's the scenario i have an item (e.g. item1000) which is not in view, user has to scroll to see it and i want to drop this item under another item which is not currently in view as well.

    i have the following code.
    [ ] sView2.ExposeItem (sDropObject)
    [ ] sView2.Select (sDropObject)
    [ ]
    [ ] sView1.BeginDrag(1, sDragObject)
    [ ] sView2.EndDrag (sDropObject)
    [ ] Sleep (1)
    [ ]

    it works fine if items i am working with are both in view but becomes troublesome when they are not. i have attempted to use EndDragAt() and that didn't work. does anyone have any workarounds to suggest?

    thank you!

    ------------------

  2. #2
    Senior Member
    Join Date
    Dec 2001
    Location
    San Jose, CA
    Posts
    102
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    Since it works if both folders are in view.
    So, why don't you try to test that both folders are in veiw first (if not, do necessary steps to show them in view) and do the drag n/ drop?

    Michael

    ------------------

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    what happens if you call ExposeItem between the Drag and Drop methods.

    ------------------
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  4. #4
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    I wrote a method that traverses the tree by expanding each node progressively. Use the GetField function to determine each node segment and then expand each one individually. Once all of the nodes have been expanded (thus loading the items into memory), Silk can expose the correct node. Remember, that trees load dynamically - meaning that the sub-items are not in the tree until the parent node has been expanded (for most trees, that is).

    Hope this helps,
    Steve


    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  5. #5
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by TonyM:
    what happens if you call ExposeItem between the Drag and Drop methods.

    <HR></BLOCKQUOTE>

    i tried this but still it attempts to drop it on some area in the treeview, topmost area of the treeview which is not right. i can actually see the object being dragged and dropped but just at the wrong place. when the object is dropped, it doesn't actually get dropped.


    ------------------


    [This message has been edited by mbt011 (edited 01-28-2003).]

  6. #6
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Carrick1973:
    I wrote a method that traverses the tree by expanding each node progressively. Use the GetField function to determine each node segment and then expand each one individually. Once all of the nodes have been expanded (thus loading the items into memory), Silk can expose the correct node. Remember, that trees load dynamically - meaning that the sub-items are not in the tree until the parent node has been expanded (for most trees, that is).

    Hope this helps,
    Steve


    <HR></BLOCKQUOTE>

    i have no problem expanding the treeview. actually, prior to me dragging and dropping items on the treeview, i make sure all trees are expanded.



    ------------------

  7. #7
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    Ah,
    I thought that it was an issue with getting the node into view. I had a similar problem with an OLETreeView Drag/Drop. What I did was determine the location of the node, and then dragged to the point, rather then the path. Here is the code that I created for determing the node POINT.

    Hope this helps,
    Steve

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

  8. #8
    Member
    Join Date
    Jun 2002
    Location
    california
    Posts
    60
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Carrick1973:
    Ah,
    I thought that it was an issue with getting the node into view. I had a similar problem with an OLETreeView Drag/Drop. What I did was determine the location of the node, and then dragged to the point, rather then the path. Here is the code that I created for determing the node POINT.

    Hope this helps,
    Steve

    <HR></BLOCKQUOTE>

    Thanks for sharing your code, Steve. Just a question on your code above, you have a user defined function called 'Expose()' What does this function do, does it just simply expose the item?


    ------------------

  9. #9
    Member
    Join Date
    May 2001
    Location
    Rochester, NY, USA
    Posts
    61
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: drag and drop problem

    No problem.
    Expose is the method that I mentioned previously. It progressively expands each node of the path that you want to select.
    Here is the code:

    Hope it helps.

    Steve

    ------------------
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity
    Steven P. Blunt
    Software Automation Technical Lead
    NASG Sales Force Productivity

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 06:01 AM.

Copyright BetaSoft Inc.