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

Disable upload button programmatically

2 Answers 82 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Licenses
Top achievements
Rank 1
Licenses asked on 23 Aug 2010, 09:51 AM

Hello,

I'm using your RadUpload control in my silverlight application. When the user has selected a file for upload, some logic is executed to determine the name and extension of the selected file and to set additional post fields. (I use the FilesSelected event for that).

But I would like to disable the upload button programmatically when something goes wrong while this logic is executed, so that the user can not upload the file. What is the best way to implement this functionality?

Thanks,
Sodi

2 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 26 Aug 2010, 12:34 PM
Hello Sodi We,

You can access the UploadButton element (named "UploadButton") from the Controltemplate of the RadButton and disable it. A possible approach would be to use the ChildrenOfType() method to find all buttons in the control template of the RadUpload. And then disable the one named "UploadButton". However, you should keep in mind that you will have to use a Dispatcher to delay the disabling of the button a bit in order to implement this scenario.

I prepared a sample project illustrating this approach. Give it a try and let me know if it works for you.

All the best,
Tina Stancheva
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
Licenses
Top achievements
Rank 1
answered on 30 Aug 2010, 08:15 AM

Hello Tina,

Thank you for the sample project. This solution works for me.

Kind regards,
Sodi
Tags
Upload
Asked by
Licenses
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Licenses
Top achievements
Rank 1
Share this question
or