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

Drag&Drop to RadUpload control

1 Answer 79 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Mikael Adolfsson
Top achievements
Rank 1
Mikael Adolfsson asked on 10 Feb 2010, 02:58 PM
Hi,

I have a case where I would like the user to be able to drag files from the local computer and drop them onto the upload control.

I can set AllowDrop="true" and bind to the Drop event and read the files, but how do I add them into the RadUpload control so it can handle the upload to the server? (I'm using SL4) Here is an example:

<telerikInput:RadUpload AllowDrop="True" Drop="UploadControl_Drop" x:Name="UploadControl" ... /> 

private void UploadControl_Drop(object sender, DragEventArgs e) 
    if (e.Data == null
        return
 
    foreach (FileInfo file in (FileInfo[]) e.Data.GetData(DataFormats.FileDrop)) 
    { 
        using (FileStream sr = file.OpenRead()) 
        { 
            // the file can be read here. 
        } 
 
        // Could something like this be done (the code below does not work) 
        RadUploadSelectedFile item = new RadUploadSelectedFile(file); 
        UploadControl.Items.Add(item); 
    } 

Many thanks!

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 10 Feb 2010, 03:07 PM
Hi Mikael Adolfsson,

This feature is planned for implementation when SL4 is RTM. It is not available now.

All the best,
Valentin.Stoychev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Upload
Asked by
Mikael Adolfsson
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or