RadUpload and cursor

6 posts, 0 answers
  1. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 02 Jul 2013 Link to this post

    Good morning

    I have a problem with this control, I have an area where I must drag and drop a file, but i need that only in this area the icon that indicate you can drag and drop, in other case must be the normal cursor.

    Thanks.
  2. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 03 Jul 2013 Link to this post

    Hi again,

    Basically i need drag a file from desktop (for example) to the area, I need set the mouse cursor.

    Thanks.
  3. DevCraft banner
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 05 Jul 2013 Link to this post

    Hi Leonard,

    Can you please take a look at this online demo and see how we implement such functionality. Basically, you need to subscribe to the native DragEnter event on the RadUploadDropPanel  and change the mouse cursor according your needs.

    I hope this information will help you.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Leonard
    Leonard avatar
    22 posts
    Member since:
    Jan 2013

    Posted 08 Jul 2013 Link to this post

    Hi Pavel thanks for your answer

    I tested your recommendation as follow:

    private void UIElement_OnDragEnter(object sender, DragEventArgs e)
    {
    this.Cursor = Cursors.Hand;
    }

    anyway I can not get change the cursor while I'm dragging the file from the desktop (see image).
    In the demo does not work.

    Thanks.
  6. Tomas
    Tomas avatar
    3 posts
    Member since:
    Apr 2013

    Posted 08 Jul 2013 Link to this post

    Hi,
    We have the same problem, we did a quickly test in the code of the demo project and it doesn't work how we expected. In our test the backgorud change correctly but the cursor doesn't change. Are we missing something here ?...

    Check the  code lines

    RadUploadDropPanel1.Cursor = Cursors.Wait;

     

    RadUploadDropPanel1.Cursor = Cursors.Arrow;


    private void RadUploadDropPanel1_DragEnter(object sender, DragEventArgs e)
            {
                Color backgroundColor = new Color();
     
                backgroundColor = Colors.Green;
     
                this.RadUploadDropPanel1.Background = new SolidColorBrush(backgroundColor);
                RadUploadDropPanel1.Cursor = Cursors.Wait;
            }
     
            private void RadUploadDropPanel_DragLeave(object sender, DragEventArgs e)
            {
                this.RadUploadDropPanel1.Background = new SolidColorBrush(Colors.White);
                RadUploadDropPanel1.Cursor = Cursors.Arrow;
            }
     
            private void Grid_DragEnter(object sender, DragEventArgs e)
            {
            }
     
            private void RadUploadDropPanel1_DragOver(object sender, DragEventArgs e)
            {
                RadUploadDropPanel1.Cursor = Cursors.Eraser;
            }
  7. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 11 Jul 2013 Link to this post

    Hi guys,

    Unfortunately in Silverlight during a native drag operation, the Cursor of a control cannot be updated. Please accept my apology for this misunderstanding.

    Regards,
    Tina Stancheva
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
DevCraft banner