OnActionComplete args.data is null
hi all
im using grid in batch mode and list binding server side blazor
but when edit and update grid , onActionComlete args.data is null
<EjsGrid DataSource="@Orders" TValue="Order"
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })"
>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="Syncfusion.EJ2.Blazor.Grids.EditMode.Batch"></GridEditSettings>
<GridEvents OnActionComplete="ActionCompletedHandler1" TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) IsPrimaryKey="true" HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
@*<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>*@
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</EjsGrid>
Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })"
>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="Syncfusion.EJ2.Blazor.Grids.EditMode.Batch"></GridEditSettings>
<GridEvents OnActionComplete="ActionCompletedHandler1" TValue="Order"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) IsPrimaryKey="true" HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
@*<GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" Format="d" Type="ColumnType.Date" TextAlign="TextAlign.Right" Width="130"></GridColumn>*@
<GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</EjsGrid>
public void ActionCompletedHandler1(ActionEventArgs<Order> args)//args data is null
{
// Here you can customize your code
if ((args?.Action ?? "").Length > 0)
{
}
}
{
// Here you can customize your code
if ((args?.Action ?? "").Length > 0)
{
}
}
how to resolve this problem?
thanks
SIGN IN To post a reply.
1 Reply
VN
Vignesh Natarajan
Syncfusion Team
February 24, 2020 11:04 AM UTC
Hi Ali,
Greetings from Syncfusion support.
Query: “im using grid in batch mode and list binding server side blazor && but when edit and update grid , onActionComlete args.data is null”
From your query we understand that you want an event to be triggered while performing CRUD action in Grid with Batch editing. Since you are using Cell based editing (Batch), we suggest you to refer the below Cell based event (CellSaved, OnCellEdit & etc.) to achieve your requirement.
|
<EjsGrid DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315"> <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"></GridEditSettings>
. . . . .. . .
</EjsGrid>
@code{
public List<Order> Orders { get; set; } public void Saved(CellSaveArgs<Order> Args){ }
public void BeforeAdd(BeforeBatchAddArgs<Order> Args) { }
public void BeforeDelete(BeforeBatchDeleteArgs<Order> Args) { }
public void BeforeSave(BeforeBatchSaveArgs Args) { }
.. . . . . . ..
}
|
Note: OnActionComplete event will return data only when it is Normal or Dialog editing. For batch editing kindly use any of the suggested events.
Refer our UG documentation for your reference
Kindly get back to us if you have any other queries.
Regards,
Vignesh Natarajan.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
AL ALI
- Feb 23, 2020 12:01 AM UTC
- Feb 24, 2020 11:04 AM UTC