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

Item removed event

3 Answers 61 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 10 Sep 2009, 01:16 AM
Is there an event that triggers when Item is removed from selected files list, before upload, by clicking on X button.
I am creating a Thumbnail gallery in FilesSelected event handler, and I want to remove thumbnails when an item (file) is removed from the selected list.

Thanks,
   Alex

3 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 15 Sep 2009, 04:30 PM
Hello Alex,

Thank you for your interest in the RadUpload control.

The current version does not fire an ItemDeleted event. In order to respect the item deletion you should implement a timer (DispatcherTimer) and on its Tick event to check the count of the uploader's items. Below is a sample code:

int countUploadItems = 0; 
DispatcherTimer myTimer; 
... 
this.myTimer = new System.Windows.Threading.DispatcherTimer(); 
this.myTimer.Tick += this.MyTimerTick; 
this.myTimer.Interval = TimeSpan.FromMilliseconds(999); 
... 
private void MyTimerTick(object sender, EventArgs e) 
    if (this.countUploadItems != this.radUpload.CurrentSession.ValidFiles.Count) 
    { 
        this.countUploadItems = this.radUpload.CurrentSession.ValidFiles.Count; 
        // put here your code to correct the image gallery. 
    } 
 

We hope this information will help you.

Best wishes,
Ivan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Joanna
Top achievements
Rank 1
answered on 16 Feb 2011, 09:36 PM
Has there been any changes to this in later versions?
0
Alex Fidanov
Telerik team
answered on 18 Feb 2011, 09:23 AM
Hello Joanna,

 Currently, the RadUploadItem exposes the PreviewDelete and Delete routed events. The PreviewDelete event can be handled if you want to stop the item from being removed. Please note that these events are raised when the item is deleted through the UI (with the delete button of the RadUploadItem).

Kind regards,
Alex Fidanov
the Telerik team
Tags
Upload
Asked by
Alex
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Joanna
Top achievements
Rank 1
Alex Fidanov
Telerik team
Share this question
or