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

RadUpload showfiledialog error

3 Answers 37 Views
Upload
This is a migrated thread and some comments may be shown as answers.
ere gon
Top achievements
Rank 1
ere gon asked on 01 Nov 2010, 04:17 PM

Hi
I am upgrading latest telerik binaries and in upgradation, I have one issue in RadUpload.

When RadUpload.ShowFileDialog(); method called it will through the error as follows

System.Security.SecurityException: Dialogs must be user-initiated.


i saw your answer to this question: "Yes, indeed this is a restriction of Silverlight. The file dialogs can only be shown in a callstack (handler) of a user's MouseButton event. We cannot work around this limitation and hence the method should only be called in a handler of a user action".

i cant understand the answer, can you please send me a sample, on how i can upload files using the radupload.

Thanks

3 Answers, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 03 Nov 2010, 09:17 AM
Hello ere gon,

An OpenFileDialog can be opened only through a user's action. It cannot be opened from procedural code, which is what happens when you execute the ShowFileDialog method. This method will have to be called for example from inside a button's click event, which is what happens when you click on the "Browse" button of the RadUpload. Examples of how you can upload files with the RadUpload you may find in the QSF sample as well as walkthrough articles in our help here.

Regards,
Alex Fidanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ere gon
Top achievements
Rank 1
answered on 03 Nov 2010, 09:51 AM
Hi

This is exactly what i do :

private

 

 

void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)

 

{

 

 

this.radUpload.ShowFileDialog();

 

}

 

 

still i get the error,

can you please write to me, what i should write in the buttonclick event.

 

 

0
Alex Fidanov
Telerik team
answered on 05 Nov 2010, 03:59 PM
Hello ere gon,

I have the very same code working correctly with me. Is it possible to provide us with the application that you are testing this on (together with the assemblies) so that we can look into this? If so, you can open a support ticket and attach the project there or use some temporary online file storage.

Thank you.

All the best,
Alex Fidanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload
Asked by
ere gon
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
ere gon
Top achievements
Rank 1
Share this question
or