New to Telerik UI for BlazorStart a free 30-day trial

A component that lets you select files via dialog or drag-and-drop without uploading. Supports preloaded files, selection and removal events (with cancellation), validation (extensions, min/max size), multiple selection, keyboard navigation, and integration with drop zones.

Definition

Namespace:Telerik.Blazor.Components

Assembly:Telerik.Blazor.dll

Syntax:

C#
public class TelerikFileSelect : TelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

Inheritance: objectComponentBaseBaseComponentTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>TelerikFileSelect

Implements: IComponentIDisposableIHandleAfterRenderIHandleEvent

Inherited Members TelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.OnAfterRenderAsync(bool)TelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.ClearFiles()TelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.OpenSelectFilesDialog()TelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.SelectFilesButtonTemplateTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.EnabledTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.MultipleTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.AcceptTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.AllowedExtensionsTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.MinFileSizeTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.MaxFileSizeTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.IdTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.CaptureTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.DropZoneIdTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.AriaDescribedByTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.AriaLabelledByTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.FilesTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.FileTemplateTelerikUploadBase<FileSelectFileInfo, FileSelectFileTemplateContext, FileSelectFileInfoTemplateContext>.FileInfoTemplateBaseComponent.ShouldRender()BaseComponent.OnInitializedAsync()BaseComponent.OnAfterRenderAsync(bool)BaseComponent.Dispose()BaseComponent.InitLocalizer()BaseComponent.ThrowIfParameterIsNull(object, string)BaseComponent.HaveOptionsChanged(IDictionary<string, object>, IDictionary<string, object>)BaseComponent.GetClassString(params string[])BaseComponent.InvokeAsync<T>(string, params object[])BaseComponent.InvokeAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidAsync(string, params object[])BaseComponent.InvokeVoidAsyncWithoutAwait(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, params object[])BaseComponent.InvokeComponentMethodAsync<T>(string, CancellationToken, params object[])BaseComponent.InvokeVoidComponentMethodAsync(string, params object[])BaseComponent.InvokeComponentVoidMethodAsync(string, object)BaseComponent.InvokeDisposeAsync()BaseComponent.StateHasChanged()BaseComponent.RootComponentBaseComponent.ClassComponentBase.OnParametersSet()ComponentBase.OnParametersSetAsync()ComponentBase.OnAfterRender(bool)ComponentBase.InvokeAsync(Action)ComponentBase.InvokeAsync(Func<Task>)ComponentBase.DispatchExceptionAsync(Exception)ComponentBase.SetParametersAsync(ParameterView)...

Constructors

C#
public TelerikFileSelect()

Properties

C#
[CascadingParameter(Name = "DropZoneClass")]
public string DropZoneClass { get; set; }

Files

IEnumerable<FileSelectFileInfo>

Preloads a collection of files to display in the FileSelect component during initialization. Use to show previously selected files, restore user sessions, or display files from server storage. Files appear in the file list as if they were selected by the user, supporting standard interactions like removal. INITIALIZATION: Files are loaded once during component initialization and become part of the current selection. RESTORATION: Essential for maintaining file selection state across page navigation or application restarts.

C#
[Parameter]
public IEnumerable<FileSelectFileInfo> Files { get; set; }

Fires before a file is removed from the selection list, allowing validation and cancellation of the removal action. Use this event to confirm file removal, clean up resources, or prevent accidental deletion of important files. Event provides access to the file being removed with all its metadata and current state information. CANCELLATION: Set IsCancelled to true to prevent the file from being removed. CLEANUP: Ideal for disposing file streams, clearing temporary data, or updating related UI state.

C#
[Parameter]
public EventCallback<FileSelectEventArgs> OnRemove { get; set; }

Fires when users select one or more files through the file dialog or drag-and-drop interaction. Use this event to handle file validation, preview generation, data processing, or custom upload logic. Event provides access to selected files with metadata including name, size, extension, and content stream. CANCELLATION: Set IsCancelled to true to prevent files from being added to the file list. ASYNC: Supports asynchronous operations for file processing, validation, or server communication.

C#
[Parameter]
public EventCallback<FileSelectEventArgs> OnSelect { get; set; }
C#
[CascadingParameter(Name = "RenderAsHiddenInput")]
public bool RenderAsHiddenInput { get; set; }
C#
[CascadingParameter(Name = "ShowFileList")]
public bool ShowFileList { get; set; }

Methods

C#
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters:__builderRenderTreeBuilder

Overrides: ComponentBase.BuildRenderTree(RenderTreeBuilder)

C#
protected override void OnInitialized()

Overrides: ComponentBase.OnInitialized()

Removes the file with the specified identifier from the collection.

C#
public void RemoveFile(string fileId)
Parameters:fileIdstring

The unique identifier of the file to remove.