[index.razor]
...
<EjsGrid @ref="@grid" TValue="Order" AllowPaging="true" AllowSorting="true" AllowGrouping="true" AllowFiltering="true" Toolbar="@(new List<string> { "Add", "Edit", "Delete", "Update", "Cancel"})">
<GridPageSettings PageSize="4"></GridPageSettings>
<EjsDataManager Url="/api/Default" Adaptor="Adaptors.WebApiAdaptor"></EjsDataManager>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"></GridEditSettings>
<GridColumns>
<GridColumn Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="@TextAlign.Right" Width="90"></GridColumn>
...
</GridColumns>
</EjsGrid>
@code{
EjsGrid<Order> grid;
...
} |
[DefaultController]
[HttpPost]
public object Post([FromBody]Orders Order)
{
/// code for Insert operation
}
//// PUT: api/Default/5
[HttpPut]
public object Put([FromBody]Orders Order)
{
/// code for Update operation
}
//// DELETE: api/ApiWithActions/5
[HttpDelete("{id}")]
public void Delete(int id)
{
/// code for delete operation
} |
|
...
@using Syncfusion.EJ2.Blazor.Calendars
<EjsGrid @ref="@grid" TValue="Order" AllowPaging="true" AllowSorting="true" AllowGrouping="true" AllowFiltering="true" Toolbar="@(new List<string> { "Add", "Edit", "Delete", "Update", "Cancel"})">
...
<GridColumns>
...
<GridColumn Field="OrderDate" HeaderText=" Order Date" EditType="datepickeredit" Edit="@(new { @params = new Syncfusion.EJ2.Blazor.Calendars.EjsDatePicker() { Start = CalendarView.Decade, Depth = CalendarView.Decade } })" Format="y" TextAlign="TextAlign.Right" Width="130"></GridColumn>
</GridColumns>
</EjsGrid>
|