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

DragDrop behaviour in ButtonElement

1 Answer 43 Views
Buttons, RadioButton, CheckBox, etc
This is a migrated thread and some comments may be shown as answers.
Antonis
Top achievements
Rank 1
Antonis asked on 05 Nov 2009, 03:18 PM
Hi,
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

1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 06 Nov 2009, 12:09 PM
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.

Regards,
Victor
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.
Tags
Buttons, RadioButton, CheckBox, etc
Asked by
Antonis
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or