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/templates.md
+115-9Lines changed: 115 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Templates
3
3
page_title: FileSelect Templates
4
-
description: Discover the Blazor FileSelect component templates that enable you to customize the rendered button. The templates allow you to change the text and add custom content.
4
+
description: Discover the Blazor FileSelect component templates that enable you to customize the rendered button and file list items. The templates allow you to change the text and add custom content.
5
5
slug: fileselect-templates
6
6
tags: telerik,blazor,fileselect,templates
7
7
published: True
@@ -10,19 +10,125 @@ position: 30
10
10
11
11
# FileSelect Templates
12
12
13
+
The FileSelect component provides templates that allow you to customize the rendering of the select files button and the file list items.
The `SelectFilesButtonTemplate` allows you to modify the **Select Files...** button. It lets you change the default text of the button and include custom content like an [icon](slug:common-features-icons) or image.
14
22
15
23
>caption Using FileSelect SelectFilesButtonTemplate
16
24
17
25
```CSHTML
18
-
<div>
19
-
<TelerikFileSelect>
20
-
<SelectFilesButtonTemplate>
21
-
<TelerikSvgIcon Icon="@SvgIcon.Upload" />
22
-
Click to Select Files for Upload
23
-
</SelectFilesButtonTemplate>
24
-
</TelerikFileSelect>
25
-
</div>
26
+
<TelerikFileSelect>
27
+
<SelectFilesButtonTemplate>
28
+
<TelerikSvgIcon Icon="@SvgIcon.Upload" />
29
+
Click to Select Files for Upload
30
+
</SelectFilesButtonTemplate>
31
+
</TelerikFileSelect>
32
+
```
33
+
34
+
## FileTemplate
35
+
36
+
The `FileTemplate` allows full customization of the items in the file list. When you use this template, all built-in elements such as the file size, name, icon, and action buttons are replaced by the content you provide within the template.
37
+
38
+
The `FileTemplate` exposes a `context` of type `FileTemplateContext` that provides access to the file information through the `File` property.
39
+
40
+
The example below demonstrates how to use the `RemoveFileAsync()` method to remove files programmatically from the collection.
The `FileInfoTemplate` allows you to customize the general file information section while preserving the rest of the built-in features such as the file icon and action buttons.
113
+
114
+
The `FileInfoTemplate` exposes a `context` of type `FileInfoTemplateContext` that provides access to the file information through the `File` property.
Copy file name to clipboardExpand all lines: components/upload/overview.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,13 +236,18 @@ The following table lists the Upload parameters. Also check the [Upload API Refe
236
236
237
237
## Upload Reference and Methods
238
238
239
-
The Upload exposes methods for programmatic operation. To use them, define a reference to the component instance with the `@ref` attribute (example below). The Upload methods are:
239
+
The Upload exposes methods for programmatic operation. To use them, define a reference to the component instance with the `@ref` attribute. The Upload methods are:
240
240
241
241
| Method | Description |
242
242
| --- | --- |
243
-
|`ClearFiles`| Clears all files from the list, both uploaded and in queue. |
244
-
|`OpenSelectFilesDialog`| Shows the browser's file selection dialog. This method [doesn't work in Safari due to browser security restrictions](slug:upload-kb-openselectfilesdialog-safari). |
245
-
|`UploadFiles`| Uploads all valid selected files. Fires the [OnUpload](slug:upload-events#onupload) event. |
243
+
|`CancelFile(string fileId)`| Cancels the upload of the specified file and removes it from the collection. |
244
+
|`ClearFiles()`| Clears all files from the list, both uploaded and in queue. |
245
+
|`OpenSelectFilesDialog()`| Shows the browser's file selection dialog. This method [doesn't work in Safari due to browser security restrictions](slug:upload-kb-openselectfilesdialog-safari). |
246
+
|`PauseFile(string fileId)`| Pauses the upload of the file with the specified identifier, if it exists in the current collection. |
247
+
|`RemoveFile(string fileId)`| Removes the file with the specified identifier from the collection. |
248
+
|`ResumeFile(string fileId)`| Resumes the upload process for the specified file. |
249
+
|`RetryFile(string fileId)`| Attempts to retry the upload of a file with the specified identifier. |
250
+
|`UploadFiles()`| Uploads all valid selected files. Fires the [OnUpload](slug:upload-events#onupload) event. |
246
251
247
252
>caption Get reference to the Upload and execute methods
Copy file name to clipboardExpand all lines: components/upload/templates.md
+114-7Lines changed: 114 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Templates
3
3
page_title: Upload Templates
4
-
description: Discover the Blazor Upload component templates that enable you to customize the rendered button. Through these templates, you to change the text and add custom content.
4
+
description: Discover the Blazor Upload component templates that enable you to customize the rendered button and file list items. Through these templates, you can change the text and add custom content.
5
5
slug: upload-templates
6
6
tags: telerik,blazor,upload,templates
7
7
published: True
@@ -10,17 +10,124 @@ position: 30
10
10
11
11
# Upload Templates
12
12
13
+
The Upload component provides templates that allow you to customize the rendering of the select files button and the file list items.
The `SelectFilesButtonTemplate` allows you to modify the **Select Files...** button. It lets you change the default text of the button and include custom content like an [icon](slug:common-features-icons) or image.
14
22
15
23
>caption Using Upload SelectFilesButtonTemplate
16
24
17
25
```RAZOR
18
-
<TelerikUpload>
19
-
<SelectFilesButtonTemplate>
20
-
<TelerikSvgIcon Icon="@SvgIcon.Upload" />
21
-
Click to Select Files for Upload
22
-
</SelectFilesButtonTemplate>
23
-
</TelerikUpload>
26
+
<TelerikUpload>
27
+
<SelectFilesButtonTemplate>
28
+
<TelerikSvgIcon Icon="@SvgIcon.Upload" />
29
+
Click to Select Files for Upload
30
+
</SelectFilesButtonTemplate>
31
+
</TelerikUpload>
32
+
```
33
+
34
+
## FileTemplate
35
+
36
+
The `FileTemplate` allows full customization of the items in the file list. When you use this template, all built-in elements such as the progress bar, action buttons, file size, name, and icon are replaced by the content you provide within the template.
37
+
38
+
The `FileTemplate` exposes a `context` of type `FileTemplateContext` that provides access to the file information through the `File` property.
39
+
40
+
The example below demonstrates how to use the `RemoveFileAsync()` method to remove files programmatically from the collection. You can perform most file operations programmatically through the [Upload component methods](slug:upload-overview#upload-reference-and-methods).
The `FileInfoTemplate` allows you to customize the general file information section while preserving the rest of the built-in features such as the file icon, progress bar, and action buttons.
112
+
113
+
The `FileInfoTemplate` exposes a `context` of type `FileInfoTemplateContext` that provides access to the file information through the `File` property.
0 commit comments