I have used sfgrid control in Batch Mode for crud operations.The default "update" button in grid toolbar is working fine When I add new record in grid by batch mode.But when I use "Endedit" function then the newly added record is not updating in list datasource.please advise how to use exact method for Endedit functions.
Please help It's my top most urgent task, without the help of support team I can't finish my task
Please help...
Awaiting for reply...
I have revived above code but still not working.
pls check my cooments in below screencast
|
<button @onclick="Update">Update</button>
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"
ShowConfirmDialog="false"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" TextAlign="TextAlign.Right" ValidationRules="@(new ValidationRules { Required = true })" Type="ColumnType.Number" Width="120"></GridColumn>
. . .
</GridColumns>
</SfGrid> |
Thanks
I have another clarification
I have an Invoice Entry Page which contains
1.Invoice Header components (which contains five textbox and one save button)
2.Invoice Details Components (which contains grid control in Batch mode)
I would like to know how to use "Endedit" function when I click on save button from Header components
Note:-
I can use Endedit function if Header and details information in same components
But my requirement how to call Endedit functions from one components to other.
Hope it's clear
Is it possible to get reply today??
|
[Index.razor]
@using Syncfusion.Blazor.Grids
<button @onclick="OnOpenButtonClick">Open</button>
<InvoiceDetail @ref="Detail"></InvoiceDetail>
@code {
private InvoiceDetail Detail { get; set; }
// 👇 Call the public methods of the component
private async Task OnOpenButtonClick() => await Detail.Update();
} |
|
[InvoiceDetail.razor]
@using Syncfusion.Blazor.Grids
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Delete", "Update", "Cancel" })" Height="315">
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Batch"
ShowConfirmDialog="false"></GridEditSettings>
<GridColumns>
. . .
</GridColumns>
</SfGrid>
@code{
SfGrid<Order> Grid;
. ..
public async Task Update()
{
await Grid.EndEditAsync();
@*await Grid.EndEdit();*@
}
} |