Class RadzenFileInput<TValue>
RadzenFileInput component.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenFileInput<TValue> : FormComponent<TValue>, IDisposable, IRadzenFormComponent
Type Parameters
Name | Description |
---|---|
TValue | The type of the value. |
Examples
<RadzenFileInput @bind-Value=@employee.Photo TValue="string" Change=@(args => Console.WriteLine($"File content as base64 string: {args}")) />
Fields
fileUpload
Gets file input reference.
Declaration
protected ElementReference fileUpload
Field Value
Type | Description |
---|---|
ElementReference |
Properties
Accept
Gets or sets the comma-separated accepted MIME types.
Declaration
public string Accept { get; set; }
Property Value
Type | Description |
---|---|
System.String | The comma-separated accepted MIME types. |
ChooseText
Gets or sets the choose button text.
Declaration
public string ChooseText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The choose button text. |
DeleteText
Gets or sets the delete button text.
Declaration
public string DeleteText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The delete button text. |
Error
Gets or sets the error callback.
Declaration
public EventCallback<UploadErrorEventArgs> Error { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<UploadErrorEventArgs> | The error callback. |
FileName
Gets or sets the image file name.
Declaration
public string FileName { get; set; }
Property Value
Type | Description |
---|---|
System.String | The image file name. |
FileNameChanged
Gets or sets the FileName changed.
Declaration
public EventCallback<string> FileNameChanged { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<System.String> | The FileName changed. |
FileSize
Gets or sets the image file size.
Declaration
public long? FileSize { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Int64> | The image file size. |
FileSizeChanged
Gets or sets the FileSize changed.
Declaration
public EventCallback<long?> FileSizeChanged { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<System.Nullable<System.Int64>> | The FileSize changed. |
ImageAlternateText
Gets or sets the text.
Declaration
public string ImageAlternateText { get; set; }
Property Value
Type | Description |
---|---|
System.String | The text. |
ImageClick
Gets or sets the image click callback.
Declaration
public EventCallback<MouseEventArgs> ImageClick { get; set; }
Property Value
Type | Description |
---|---|
EventCallback<MouseEventArgs> | The image click callback. |
ImageStyle
Gets or sets the image style.
Declaration
public string ImageStyle { get; set; }
Property Value
Type | Description |
---|---|
System.String | The image style. |
InputAttributes
Specifies additional custom attributes that will be rendered by the input.
Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type | Description |
---|---|
IReadOnlyDictionary<System.String, System.Object> | The attributes. |
MaxFileSize
Gets or sets the maximum size of the file.
Declaration
public int MaxFileSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum size of the file. |
MaxHeight
Gets or sets the maximum height of the file, keeping aspect ratio.
Declaration
public int MaxHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum height of the file. |
MaxWidth
Gets or sets the maximum width of the file, keeping aspect ratio.
Declaration
public int MaxWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum width of the file. |
Title
Gets or sets the title.
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The title. |
Methods
GetComponentCssClass()
Gets the component CSS class.
Declaration
protected override string GetComponentCssClass()
Returns
Type | Description |
---|---|
System.String |
Overrides
OnAfterRenderAsync(Boolean)
Called by the Blazor runtime.
Declaration
protected override async Task OnAfterRenderAsync(bool firstRender)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | firstRender |
Returns
Type | Description |
---|---|
Task |
Overrides
OnChange(IEnumerable<PreviewFileInfo>)
Called on file change.
Declaration
public async System.Threading.Tasks.Task OnChange(IEnumerable<PreviewFileInfo> files)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<PreviewFileInfo> | files | The file. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
OnImageClick(MouseEventArgs)
Handles the ImageClick event.
Declaration
public async Task OnImageClick(MouseEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
MouseEventArgs | args | The |
Returns
Type | Description |
---|---|
Task |
SetParametersAsync(ParameterView)
Sets the parameters asynchronous.
Declaration
public override async Task SetParametersAsync(ParameterView parameters)
Parameters
Type | Name | Description |
---|---|---|
ParameterView | parameters | The parameters. |
Returns
Type | Description |
---|---|
Task | Task. |