DragDrop behaviour in ButtonElement

2 posts, 0 answers
  1. Antonis
    Antonis avatar
    3 posts
    Member since:
    Dec 2008

    Posted 05 Nov 2009 Link to this post

    I am using a ButtonElement to draw draggable images on a panel
    The problem is that the ButtonElement does not expose DrogOver,DragDrop methods so I cannot know when one ButtonElement is dragged over another.

    Is there any solution?

    Thanks in advance
  2. Victor
    Victor avatar
    1358 posts

    Posted 06 Nov 2009 Link to this post

    Hello Antonis,

    You can find out whether you are dragging over an element by handling DragOver event of RadControl in which the element is positioned and use GetElementAtPoint() method of the rad control ElementTree property. For example:
    void radListBox1_DragOver(object sender, DragEventArgs e)
        RadElement elementdUnderMouse = this.radListBox1.ElementTree.GetElementAtPoint(this.radListBox1.PointToClient(new Point(e.X, e.Y)));
        if (elementdUnderMouse != null && elementdUnderMouse is RadListBoxItem)
            // Do work with the element.

    Please write again if you have other questions.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top