You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/fileselect/events.md
+58-71Lines changed: 58 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,102 +39,85 @@ Property | Type | Description
39
39
40
40
## OnSelect
41
41
42
-
The `OnSelect` fires when one or more files have been selected. The selection of files is achieved either through the **Select files** button or by dropping the files anywhere in the component.
42
+
The `OnSelect` fires when one or more files have been selected. The selection of files is achieved either through the **Select Files** button or by dropping the files anywhere in the component.
43
43
44
44
The event handler receives a [`FileSelectEventArgs` object](#fileselectfileinfo), which contains a list of `FileInfo` objects that allow the processing of the files.
45
45
46
-
>caption Handling the `OnSelect` event of the FileSelect
46
+
See the [example below](#example).
47
47
48
-
````RAZOR
49
-
@*Handle the OnSelect event of the FileSelect to access the selected files and upload them*@
48
+
## OnRemove
49
+
50
+
The `OnRemove` fires when a file has been removed from the list of selected files either by clicking the **x** icon or by pressing the `Del` key.
51
+
52
+
The event handler receives a [`FileSelectEventArgs` object](#fileselectfileinfo). As the FileSelect component allows deleting one item at a time, the collection contains only one `FileSelectFileInfo` object (the deleted one).
50
53
51
-
@using System.IO
52
-
@using Microsoft.AspNetCore.Hosting
54
+
## Example
55
+
56
+
>caption Handling the `OnSelect` and `OnRemove` events of the FileSelect
// Saving files on the user device is not allowed in WebAssembly apps.
105
113
106
-
## OnRemove
107
-
108
-
The `OnRemove` fires when a file has been removed from the list of selected files either by clicking the **x** icon or by pressing the `Del` key.
109
-
110
-
The event handler receives a [`FileSelectEventArgs` object](#fileselectfileinfo). As the FileSelect component allows deleting one item at a time, the collection contains only one `FileSelectFileInfo` object (the deleted one).
111
-
112
-
>caption Handling the `OnRemove` event of the FileSelect
113
-
114
-
````RAZOR
115
-
@*Handle the OnRemove event of the FileSelect to access and delete the uploaded files*@
116
-
117
-
@using System.IO
118
-
@using Microsoft.AspNetCore.Hosting
119
-
@using System.Threading
120
-
@using Telerik.Blazor.Components.FileSelect
121
-
122
-
@inject IWebHostEnvironment HostingEnvironment
123
-
124
-
<div style="width:300px">
125
-
<TelerikFileSelect OnRemove=@HandleRemoveFiles
126
-
AllowedExtensions="@AllowedExtensions">
127
-
</TelerikFileSelect>
128
-
<div class="k-form-hint">
129
-
Expected files: <strong>JPG, PNG, GIF</strong>
130
-
</div>
131
-
</div>
132
-
133
-
@code {
134
-
public List<string> AllowedExtensions { get; set; } = new List<string>() { ".jpg", ".png", ".gif" };
135
-
public Dictionary<string, CancellationTokenSource> Tokens { get; set; } = new Dictionary<string, CancellationTokenSource>();
114
+
//Tokens.Add(file.Id, new CancellationTokenSource());
0 commit comments