RadPanels Drag and Drop

Thread is closed for posting
2 posts, 0 answers
  1. R
    R avatar
    8 posts
    Member since:
    Apr 2008

    Posted 30 Jun 2008 Link to this post


    I have a  RadPanel with several RadPanels inside. I want to be able to drag and drop the RadPanels to change their location inside the main RadPanel. Can you help me with that?


  2. Jack
    Jack avatar
    2333 posts

    Posted 01 Jul 2008 Link to this post


    Thank you for contacting us.

    A possible solution would be to use a descendant class of the RadPanel and override the OnMouseMove method. This behavior is demonstrated in the following code snippet:

        public class MyPanel : RadPanel 
            Point downPoint; 
            protected override void OnMouseDown(MouseEventArgs e) 
                downPoint = e.Location; 
            protected override void OnMouseMove(MouseEventArgs e) 
                if (e.Button == MouseButtons.Left) 
                    Point delta = new Point(e.X - downPoint.X, e.Y - downPoint.Y); 
                    Console.WriteLine("Delta: x = {0}, y = {1}", delta.X, delta.Y); 
                    this.Location = new Point(this.Location.X + delta.X, this.Location.Y + delta.Y); 
            public override string ThemeClassName 
                    return typeof(RadPanel).FullName; 

    I hope this helps. Do not hesitate to write me if you have any other questions.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top