<EjsGrid DataSource="@data" Allowpaging="true">
<GridAggregates>
<GridAggregate>
<GridAggregatecolumns>
<GridAggregatecolumn Field="Freight" Type="AggregateType.Sum"></GridAggregatecolumn>
</GridAggregatecolumns>
</GridAggregate>
</GridAggregates>
<GridColumns>
……………………………………………………..
</GridColumns>
</EjsGrid> |
@page "/"
@using Newtonsoft.Json;
@using Newtonsoft.Json.Converters;
<EjsUploader ID="UploadFiles" Success="@OnSuccess">
<UploaderAsyncSettings SaveUrl="api/SampleData/Save" RemoveUrl="api/SampleData/Remove"></UploaderAsyncSettings>
</EjsUploader>
<div>
<p>Uploaded File name is: @FileName</p>
</div>
@code{
public string FileName;
public void OnSuccess(object args)
{
//Deserialized the success event args using Newton soft.
SuccessEventArgs eventArgs = JsonConvert.DeserializeObject<SuccessEventArgs>(args.ToString());
// Assign the file name in the variable
FileName = eventArgs.File.Name;
// To reflect the DOM content
this.StateHasChanged();
}
//Success event args class.
public class SuccessEventArgs
{
public object E { get; set; }
public FileInfo File { get; set; }
public string StatusText { get; set; }
public string Name { get; set; }
public string Operation { get; set; }
public ResponseEventArgs Response { get; set; }
}
public class ResponseEventArgs
{
public string Headers { get; set; }
public object ReadyState { get; set; }
public object StatusCode { get; set; }
public string StatusText { get; set; }
public bool withCredentials { get; set; }
}
} |
<EjsUploader ID="UploadFiles" MaxFileSize="1048576000">
<UploaderAsyncSettings SaveUrl="api/SampleData/Save" RemoveUrl="api/SampleData/Remove" ChunkSize="500000"></UploaderAsyncSettings>
</EjsUploader> |
@using Syncfusion.EJ2.Blazor
@using Syncfusion.EJ2.Blazor.Inputs
<EjsUploader>
<UploaderEvents Success="OnSuccess"></UploaderEvents>
</EjsUploader>
@code{
public string Status { get; set; }
public void OnSuccess(SuccessEventArgs args)
{
this.Status = args.StatusText;
}
} |
@using Syncfusion.EJ2.Blazor.Inputs
<EjsUploader>
<UploaderEvents Success="OnSuccess"></UploaderEvents>
</EjsUploader>
<p>
Uploaded File name is: @FileName
</p>
@code{
public string FileName { get; set; }
public void OnSuccess(SuccessEventArgs args)
{
this.FileName = args.File.Name;
}
} |