Class RadzenFileInput<TValue>
RadzenFileInput component.
public class RadzenFileInput<TValue> : FormComponent<TValue>, IComponent, IHandleEvent, IHandleAfterRender, IDisposable, IRadzenFormComponent
Type Parameters
TValue
The type of the value.
- Inheritance
-
FormComponent<TValue>RadzenFileInput<TValue>
- Implements
- Inherited Members
Examples
<RadzenFileInput @bind-Value=@employee.Photo TValue="string" Change=@(args => Console.WriteLine($"File content as base64 string: {args}")) />
Constructors
RadzenFileInput()
public RadzenFileInput()
Fields
fileUpload
Gets file input reference.
protected ElementReference fileUpload
Field Value
Properties
Accept
Gets or sets the comma-separated accepted MIME types.
[Parameter]
public string Accept { get; set; }
Property Value
- string
The comma-separated accepted MIME types.
ChooseText
Gets or sets the choose button text.
[Parameter]
public string ChooseText { get; set; }
Property Value
- string
The choose button text.
DeleteText
Gets or sets the delete button text.
[Parameter]
public string DeleteText { get; set; }
Property Value
- string
The delete button text.
Error
Gets or sets the error callback.
[Parameter]
public EventCallback<UploadErrorEventArgs> Error { get; set; }
Property Value
- EventCallback<UploadErrorEventArgs>
The error callback.
FileName
Gets or sets the image file name.
[Parameter]
public string FileName { get; set; }
Property Value
- string
The image file name.
FileNameChanged
Gets or sets the FileName changed.
[Parameter]
public EventCallback<string> FileNameChanged { get; set; }
Property Value
- EventCallback<string>
The FileName changed.
FileSize
Gets or sets the image file size.
[Parameter]
public long? FileSize { get; set; }
Property Value
- long?
The image file size.
FileSizeChanged
Gets or sets the FileSize changed.
[Parameter]
public EventCallback<long?> FileSizeChanged { get; set; }
Property Value
- EventCallback<long?>
The FileSize changed.
ImageAlternateText
Gets or sets the text.
[Parameter]
public string ImageAlternateText { get; set; }
Property Value
- string
The text.
ImageClick
Gets or sets the image click callback.
[Parameter]
public EventCallback<MouseEventArgs> ImageClick { get; set; }
Property Value
- EventCallback<MouseEventArgs>
The image click callback.
ImageStyle
Gets or sets the image style.
[Parameter]
public string ImageStyle { get; set; }
Property Value
- string
The image style.
InputAttributes
Specifies additional custom attributes that will be rendered by the input.
[Parameter]
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
- IReadOnlyDictionary<string, object>
The attributes.
MaxFileSize
Gets or sets the maximum size of the file.
[Parameter]
public int MaxFileSize { get; set; }
Property Value
- int
The maximum size of the file.
MaxHeight
Gets or sets the maximum height of the file, keeping aspect ratio.
[Parameter]
public int MaxHeight { get; set; }
Property Value
- int
The maximum height of the file.
MaxWidth
Gets or sets the maximum width of the file, keeping aspect ratio.
[Parameter]
public int MaxWidth { get; set; }
Property Value
- int
The maximum width of the file.
Title
Gets or sets the title.
[Parameter]
public string Title { get; set; }
Property Value
- string
The title.
Methods
BuildRenderTree(RenderTreeBuilder)
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builder
RenderTreeBuilder
GetComponentCssClass()
protected override string GetComponentCssClass()
Returns
OnAfterRenderAsync(bool)
protected override Task OnAfterRenderAsync(bool firstRender)
Parameters
firstRender
bool
Returns
OnChange(IEnumerable<PreviewFileInfo>)
Called on file change.
[JSInvokable("RadzenUpload.OnChange")]
public Task OnChange(IEnumerable<PreviewFileInfo> files)
Parameters
files
IEnumerable<PreviewFileInfo>The file.
Returns
OnImageClick(MouseEventArgs)
Handles the ImageClick event.
public Task OnImageClick(MouseEventArgs args)
Parameters
args
MouseEventArgsThe MouseEventArgs instance containing the event data.
Returns
SetParametersAsync(ParameterView)
public override Task SetParametersAsync(ParameterView parameters)
Parameters
parameters
ParameterView