Endedit function not working in Batch Mode

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


7 Replies

KI KINS November 2, 2021 01:29 AM UTC

Please help...

Awaiting for reply...



RN Rahul Narayanasamy Syncfusion Team November 2, 2021 11:59 AM UTC

Hi KINS, 

Greetings from Syncfusion. 

Query: Endedit function not working in Batch Mode 

We have validated your query with the provided details and checked the reported problem. We could not able to reproduce the reported problem at our end. The edited details are updated correctly while saving the values using EndEdit/EndEditAsync method. Find the below sample for your reference. 


If you are still facing the problem, then could you please share the below details. It will be helpful to validate and provide a better solution. 

  • Full Grid code snippets.
  • Video demonstration of the problem.
  • Reproduce the problem in the provided sample and revert back to us.
  • Share a simple reproduceable sample if possible.

Regards, 
Rahul 



KI KINS November 2, 2021 02:32 PM UTC

I have revived above code but still not working.

pls check my cooments in below screencast


https://www.screencast.com/t/alApwpLOx



RN Rahul Narayanasamy Syncfusion Team November 3, 2021 12:42 PM UTC

Hi KINS, 

Thanks for the update. 

We have validated your query with the provided details and you have checked the added records before the update operation occurs. We suggest you to ensure the case after ShowConfirmDialog property as false in GridEditSettings. Find the below code snippets for your reference. 

 
<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> 


Please let us know if you have any concerns. 

Regards, 
Rahul 



KI KINS November 4, 2021 07:47 AM UTC

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



KI KINS November 4, 2021 11:42 AM UTC

Is it possible to get reply  today??



RN Rahul Narayanasamy Syncfusion Team November 9, 2021 03:54 AM UTC

Hi KINS, 

Thanks for the update. 

We have validated your query and you want to call the Grid method(EndEditAsync) in another component file. You can achieve your requirement by using below way. Here, we have called Grid(which is rendered in InvoiceDetail component) EndEditAsync method from the Index.razor file. Find the below code snippets and sample for your reference. 

[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();*@ 
    } 
} 


If it does not meet your requirement, then could you please share more details about your case(full grid code snippets, reproduce case in the provided sample and revert back to us (or) share a simple sample). It will be helpful to validate and provide a better solution. 

Please let us know if you have any concerns. 

Regards, 
Rahul 
 
 


Loader.
Up arrow icon