Drag from desktop and drop in Silverlight

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

    Posted 16 Dec 2008 Link to this post

    This is what my customers wants from the application. To be able to drag and drop picture files from other applications, the File Explorer or the Desktop, to the SilverLight application. Is that supported?
  2. Miroslav
    Miroslav avatar
    922 posts

    Posted 17 Dec 2008 Link to this post

    Hello Niclas,

    Unfortunately this will not be possible, the Silverlight plugin does not yet allow us to interact with the native drag/drop APIs. As stated in the documentation as well:


    The drag-drop is entirely implemented in Silverlight and does not support cross-application scenarios.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Pushpendra
    Pushpendra avatar
    1 posts
    Member since:
    Feb 2016

    Posted 19 Feb 2016 Link to this post

    One can Drag and drop in a silverlight application. Check "Require Elevated permissions" in silverlight project properties and using drop event of silverlight datagrid one can handle the drag and drop from desktop in a silverlight datagrid provided its not an OOB silverlight application.


    private void DocumentsDrop(object sender, DragEventArgs e)


      e.Handled = true;

      var point = e.GetPosition(null);

      var dataGridRow = ExtractDataGridRow(point);

      if(dataGridRow !=null)



      var droppedItems = e.Data.GetData(DataFormats.FileDrop) as FileInfo[];

     if (droppedItems != null)


      var droppedDocumentsList = new List<FileInfo>();

     foreach (var droppedItem in droppedItems)


        if ((droppedItem.Attributes & FileAttributes.Directory) == FileAttributes.Directory)


           var directory = new DirectoryInfo(droppedItem.FullName);

          droppedDocumentsList.AddRange(directory.EnumerateFiles("*", SearchOption.AllDirectories));







       if (droppedDocumentsList.Any())



        } else


        DisplayErrorMessage("The selected folder is empty.");




    Set AllowDrop =true; in xaml for the datagrid. From the DragEventArgs extract the information as FileInfo Object.

Back to Top