4 Answers, 1 is accepted
Thank you for contacting us.
In response to your question: you just need to select an item and drop it over the other ListBox. See the attached movie for a demonstration.
We support drag-and-drop since Q1 2007. Please find our latest release - Q2 2007 ServicePack 1 available on our website. Remember to uninstall the old version of our product before installing the new one to make sure your projects are referencing the latest version of the product.
Please, let us know if we could be of any further assistance.
Sincerely yours,
Angel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
private void radListBox1_MouseDown(object sender, MouseEventArgs e)
{
if (radListBox1.GetElementAtPoint(e.Location).GetType() == typeof(RadListBoxItem))
{
RadListBoxItem item = (RadListBoxItem)radListBox1.GetElementAtPoint(e.Location);
radListBox1.SelectedItem = item;
radListBox1.DoDragDrop(item, DragDropEffects.Move);
}
}
private void radListBox2_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void radListBox2_DragDrop(object sender, DragEventArgs e)
{
RadListBoxItem item = (RadListBoxItem) e.Data.GetData(typeof(RadListBoxItem));
RadListBoxItem newitem = new RadListBoxItem(item.Text, item); //is this how to "clone" an item?
radListBox2.Items.Add(newitem);
radListBox1.Items.Remove(item);
}
We currently don't support drag-and-drop inside a ListBox or between two ListBoxes. Still, this is a valuable suggestion, and we awarded you 600 telerik points.
We will put this task in our todo list, but we cannot commit on a timeframe when it will be implemented.
In order to implement your own custom drag-and-drop, you can use the SelectedItems property if you wish to drag-and-drop the selection, or the SelectedElement property if you wish to find the item that is under the mouse pointer.
Note that, depending on the value of the SelectionMode property, multiple items could be selected. If you need to drag-and-drop the selected items, you can use the SelectedItems property. If you wish to drag-and-drop the item that is under the mouse pointer, you can use the SelectedElement property.
If you need to move an item, you can reuse the item that is being dragged. Just remove it from the source ListBox before adding it to the destination list box. Currently , cloning items is unavailable.
Thank you for contacting us. We appreciate your feedback.
Regards,
Angel
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center