Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
148069 | Oct 4,2019 03:24 AM UTC | Oct 15,2019 12:46 PM UTC | Blazor | 5 |
![]() |
Tags: Grid |
Thank you Vignesh. I will read the suggested links and view the modified sample.
Syncfusion seems very good with documentation, support and monitoring the forums. It's much appreciated.
-Travis
<EjsGrid TValue="Order" DataSource="@GridData" @ref="Grid"...>
<GridEvents OnToolbarClick="ToolbarClickHandler" OnActionComplete="OnComplete" OnActionBegin="OnBegin" TValue="Order" />
...
</EjsGrid>
@code{
EjsGrid<Order> Grid;
public static List<Order> GridData { get; set; }
protected override void OnInitialized()
{
GridData = Db.GetAllOrders().Where(x => x.CustomerID == "VINET").ToList();
}
public void OnBegin(ActionEventArgs<Order> Args)
{
if (Args.RequestType.ToString() == "Save")
{
if (Args.Data.OrderID == null)
{
var val = Db.GetAllOrders().Max(X => X.OrderID); //Fetch the max value for OrderID from db
Args.Data.OrderID = val + 1; //Auto increment the OrderID value
}
}
}
...
public void OnComplete(ActionEventArgs<Order> Args)
{
if (Args.RequestType.ToString() == "Save")
{
Args.Data.OrderID = null; //Set null for the OrderID to get saved to db
Db.AddOrder(Args.Data);
}
...
}
...
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.