Jump to content
Stefan Bender

Listbrower: Enabling Drag and Drop not working

Recommended Posts

Dear developers,


I'm trying to support drag and drop in a listbrowser control.


After creating the columns in the dialog's setup handler, I call

 Boolean det_ddc = gSDK->SetListBrowserDragAndDropColumn( m_d, item, ind_column);
   Boolean enab_dd = gSDK->EnableListBrowserDragAndDrop( m_d, item, true);


Item and column exist, either function return true for success so everything should be fine.


Unfortunately, when I'm hovering over the column, the cursor does not become the drag and drop cursor and so I  can't drag and drop anything.


Has anybody an idea which undocumented things I need to do (or must not do) beside calling these functions?


Which undocumented side effects of other SDK functions might have caused drag and drop to become disabled? There is no SDK function or member function of VWListBrowserControl to find out if drag and drop mode is actually switched on...


Thanks for any help,


Stefan Bender





Share this post

Link to post

Have you tried to switch Drag&Drop only after the data has been put in the list browser?

(At least for the hierarchical view, you have to do it that way.)

Share this post

Link to post

Thanks, but..

I've seen other dialogs that seem to work where drag and drop is also enabled before the LB is actually filled with data.

I tried what you proposed, but no effect. @Vlad Do you or the engineers in charge of listbrowsers have an idea what is wrong with EnableListBrowserDragAndDrop()? Drag and Drop support is considered to be an important feature in one of our new dialogs. Thanks!



Share this post

Link to post

Not that this should make a difference, but you can also use VWListBrowserColumn::SetAsDragAndDropColumn(). That would just give some extra checks that m_d and item are valid.


I believe the column has to be kListBrowserControlNumber. The data don't necessarily have to be numbers (you can use A, B, C, etc.), but they type has to be numeric. You'll notice on existing dialogs that you can only get the drag and drop cursor over some kind of index column.

Share this post

Link to post

>>>I believe the column has to be kListBrowserControlNumber.


Thanks, that sounds interesting. I see no reason for this condition and no mention of this anywhere, but I will have a try. Too bad that this list does not have a column where we display numbers in all lines.

Share this post

Link to post

Many years ago, there was a vectorscript tips site that included unravelling the mysteries of list browsers. It seems to be long gone, but I picked up this information there. If you did not have a numeric "sort" column , that would definitely be your issue.

  • Like 1

Share this post

Link to post
1 hour ago, Pat Stanford said:

The article on list browsers from Vectorlab has been reworked and uploaded by the author ( @_c_ ) to the devloper pages.



Indeed! Updated on December 31 of last year, no less. Thanks, @Pat Stanford (and many thanks @_c_).


The note about the numeric column for drag and drop is here: https://developer.vectorworks.net/index.php/User:CBM-c-/VS-List_Browsers_part_2#Column_Drag_and_Drop


Working with list browsers is considerably more pleasant with the SDK than with VS, but many names and requirements are still a bit opaque.


  • Like 2

Share this post

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...