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

RadListBox & DragDrop

4 Answers 103 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.
Pieter
Top achievements
Rank 2
Pieter asked on 03 Oct 2008, 09:55 AM

In my solution I had RadControls 2007 and I can drag an item from a RadList box, to a RadTextbox

After the upgrade to RadControls 2008 Q2 – the behaviour is a bit funny...

If I use the MouseDown  event

private void lstAlertTokens_MouseEnter(object sender, MouseEventArgs e)

        {

            if (lstAlertTokens.SelectedIndex >= 0)

            {

                string text = lstAlertTokens.Text;

                lstAlertTokens.DoDragDrop(text, DragDropEffects.Copy);

            }

        }

 The Drag and drops works, but when I click on items in the list, they are not selected (highlighted), I must use the up/down keyboard keys to first select the item I want, before I drag and drop it.

If I use the mouseUp event

 The item selection works now (gets highlighted) when I click the mouse , but the DragDrop effect icon is missing.. So the drag and drop works, but you don’t see the  DragDropEffects.Copy effect.

 

Any ideas?

4 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 03 Oct 2008, 02:36 PM
Hi Pieter,

Thank you for writing.

I have not managed to reproduce the described issues locally. Please, send me a small example application that demonstrates them. It will help me to understand your specific case and provide you with further assistance.
 
I am looking forward to your project.
 

Best wishes,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Pieter
Top achievements
Rank 2
answered on 06 Oct 2008, 10:00 AM
Hi Martin,

Atatched is a sample project.

Just cut/paste the mouseUp & mouseDown code to see the different effects.

Regards,
Pieter
0
Martin Vasilev
Telerik team
answered on 06 Oct 2008, 04:23 PM
Hello Pieter,

Thank you for the project.

The described behavior is because you do not have a full implementation of the Drag-and-Drop scenario. You have to handle some additional events to make the DoDragAndDrop method work properly. Please, review your modified project that have been attached to this message.

I hope this helps. Because this case is very typical, I think it will be a good idea to move this support ticket with the example project to our public forums. Please let me know your opinion about that..
 

Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Pieter
Top achievements
Rank 2
answered on 07 Oct 2008, 07:40 AM

Hi Martin,

Thanks for providing the code for those additional event handlers! The behaviour is now correct on my side.

I think it’s a very good Idea on moving the content to public forums! – Will you move the article, or is there something I must do?

Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Pieter
Top achievements
Rank 2
Answers by
Martin Vasilev
Telerik team
Pieter
Top achievements
Rank 2
Share this question
or