RadDrag and drop problem in drag cue

2 posts, 0 answers
  1. Ankit
    Ankit avatar
    4 posts
    Member since:
    Dec 2010

    Posted 19 Jan 2011 Link to this post

    hello admin,
                    i have pasted the OnDragQuery event of the drag and drop. the two lines of code in which i have given the datatemplate to the drag cue's content template is is fine enough. But the image source in the datatemplate in xaml is always static  and i' not able to bind the image source. So, instead of that i wanted to give the dragcue a new image in C#. It does work, but its not firing and triggering the mouse up event. please point out any mistake and please suggest anything new if this isn't the right way to do it. And please i don't want to use the binding, as it is not working properply. Suggest something in DEeail. In DETAIL please, or attach and perfect and suitable example..Thanks in advance. please its important



    void OnDragQuery(object sender, DragDropQueryEventArgs e)
    ContentControl dragCue = new ContentControl();
    e.QueryResult =
    dragCue.MouseUp += new MouseButtonEventHandler(dragCue_MouseUp);

    dragCue.ContentTemplate =
    this.Resources["DragTemplate"] as DataTemplate;  //is fine,
    e.Options.DragCue = dragCue;   // but has static image souce in xaml




    //Image im = new Image();             //this commented code doesn't fire
    //im.Width = 40;                     //the MouseUp event, when i        
    //im.Height = 40;                     //don't give the     
    //im.Source = new BitmapImage(new Uri(@"/Images/drive.png", UriKind.Relative));  //content template to it. want
    //e.Options.DragCue = im;             // to use it to give dynamic image
                                         //source instead 
                                        // of above highlighted code.

    e.Options.ArrowCue =
    e.Handled =





  2. Tsvyatko
    Tsvyatko avatar
    858 posts

    Posted 21 Jan 2011 Link to this post

    Hi Ankit,

    You cannot handle mouse events from the drag cue. I guess you want to do this to determine whether the drag completes or is canceled. You can do this by the e.options.status in the raddraganddropmaanger events (draqquery, draginfo, dropquery, dropinfo).

    More information can be found here:

    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top