RadListBox & DragDrop

5 posts, 0 answers
  1. Pieter
    Pieter avatar
    3 posts
    Member since:
    Jun 2007

    Posted 03 Oct 2008 Link to this post

    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?

  2. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 03 Oct 2008 Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Pieter
    Pieter avatar
    3 posts
    Member since:
    Jun 2007

    Posted 06 Oct 2008 Link to this post

    Hi Martin,

    Atatched is a sample project.

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

    Regards,
    Pieter
  5. Martin Vasilev
    Admin
    Martin Vasilev avatar
    1061 posts

    Posted 06 Oct 2008 Link to this post

    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.
  6. Pieter
    Pieter avatar
    3 posts
    Member since:
    Jun 2007

    Posted 07 Oct 2008 Link to this post

    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?

Back to Top
UI for WinForms is Visual Studio 2017 Ready