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

Programmatically firing event for Upload,Cancel,Clear

3 Answers 130 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sunny
Top achievements
Rank 1
Sunny asked on 23 Feb 2012, 04:09 AM
Hi,

I have scenario where I need to fire Cancel upload, Upload ,Clear Upload Items  programmatically  i.e with out user interaction.
How can we do this?
How can we catch  "Clear" Button events..?

Will  be great if you can give mvvm sample ..for above..

3 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 27 Feb 2012, 03:11 PM
Hi Sunny ,

 I am not sure I understand your scenario correctly. Do you need programmatic upload (without using the default Upload interface), or you need particular events ? If first, please check out the following articles and posts and let us know if they help you;
Programmatic Upload
How to Use RadUpload Programatically
I believe I've answered to your other question in other threads (how to use the Upload events in MVVM scenario) - with Galasoft MVMM Light's EventToCommand behavior.
Please let us know if you have further questions.

Kind regards,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kz
Top achievements
Rank 1
answered on 27 Feb 2012, 10:39 PM
I can not find any thing for  "ClearButton".I need   control button so that I can take some other action also.
0
Petar Mladenov
Telerik team
answered on 01 Mar 2012, 05:26 PM
Hello Sunny,

 You can use the Loaded event of the RadUpload. In it you can access the ClearButton like so:

Button clearButton= this.radUpload.ChildrenOfType<Button>().Where( b => b.Name.Equals( "ClearButton" ) ).FirstOrDefault();
If the method ChildrenOftype returns null, please try running this code block in Dispatcher.BeginInvoke({});
Once accessed, you can attach to the Click event like so:
 
cancelButton.Click += new RoutedEventHandler(cancelButton_Click);
      }
 
      void cancelButton_Click(object sender, RoutedEventArgs e)
      {
          throw new NotImplementedException();
      }

Regards,
Petar Mladenov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Upload
Asked by
Sunny
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Kz
Top achievements
Rank 1
Share this question
or