This is a migrated thread and some comments may be shown as answers.

Drag and Drop In two listbox

3 Answers 72 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
dahv
Top achievements
Rank 1
dahv asked on 07 Apr 2010, 12:11 AM
Hi, i'm trying to do the Drag and Drop like the demo, but my first listbox it's conected with my dataset and when I do the drag and drop, gives me this error:

Data bound items can not be removed. Remove items from the data source instead.

If you can explain to me how to fix this. Thank You.

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 07 Apr 2010, 02:58 PM
Hi dahv,

Thank you for the question.

When you are dragging from one listbox to another you are attempting to remove an item, which however is bound to a data record and if you remove it you will leave RadListBox in an invalid state, that is, you will desynchronize it with the data source. There is no way to fix this behavior of RadListBox.

What you need to do is create a new RadListBoxItem with the same information as the item that you are trying to drag and drop in the destination list box. You can either remove the data record for the original item from the data source, which will also remove it from the source list box, or you can simply hide it and pretend that it is deleted. You can hide it by setting its Visibility property to Hidden.

Write again if you have other questions.
 
Sincerely yours,
Victor
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
P
Top achievements
Rank 1
answered on 19 Dec 2012, 07:57 PM
I'm trying to do this, but the dragable feature is not working.  I can't drag anything.  The EnableDragAndDrop property is set to true.  
I have 2 databound listboxes.  Everything works when using the buttons.  Just need to add the drag and drop.
Please help.
Thanks.
0
Stefan
Telerik team
answered on 21 Dec 2012, 03:01 PM
Hello,

Thank you for writing. 

Please note that RadListBox is no longer part of our suite and also is no longer supported. Feel free to use its ancestor RadListControl. In order demo application you can find a sample of drag and drop between RadListControls. 

If you have any other questions regarding the new control, feel free to open a new thread in the appropriate forums: http://www.telerik.com/community/forums/winforms/dropdownlist-and-listcontrol.aspx.

I hope this helps.
 
Regards,
Stefan
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
dahv
Top achievements
Rank 1
Answers by
Victor
Telerik team
P
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or