Programmatically firing event for Upload,Cancel,Clear

4 posts, 0 answers
  1. Sunny
    Sunny avatar
    1 posts
    Member since:
    Feb 2012

    Posted 22 Feb 2012 Link to this post

    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..
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. sri
    sri avatar
    22 posts
    Member since:
    Oct 2012

    Posted 27 Feb 2012 Link to this post

    I can not find any thing for  "ClearButton".I need   control button so that I can take some other action also.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 Mar 2012 Link to this post

    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 >>
Back to Top