Grid "Update" after editing cells only "selects" the grid but doesn't fire events expected

I am using Syncfusion.Blazor 18.0.3.53, building a grid as below. 

<SfGrid DataSource="@vm.Players" Toolbar="@(new List<string>() { "Update", "Cancel" })">
        <GridEditSettings AllowEditing="true" AllowEditOnDblClick="true" Mode="EditMode.Batch"/>        
        <GridEvents TValue="VT_Player" OnBatchSave="BatchSave"/>
        <GridColumns>
            <GridColumn Field=@nameof(VT_Player.PersonId) IsPrimaryKey=true HeaderText="ID"></GridColumn>
            <GridColumn Field=@nameof(VT_Player.PersonName) HeaderText="Name" AllowEditing="false"></GridColumn>
            <GridColumn Field=@nameof(VT_Player.HandicapUser) HeaderText="User Hcp" EditType="EditType.NumericEdit"></GridColumn>
        </GridColumns>
    </SfGrid>

and in the code: 

public void BatchSave(BeforeBatchSaveArgs<VT_Player> Args){Console.WriteLine("x");}

------
The grid displays correctly.  I can double click the "HandicapUser" column and edit the number and the column turns green (edited) as expected when I leave the cell.

When I click "Update" in the toolbar, expecting the OnBatchSave to fire nothing happens except that the Grid component is selected (turns gray)

I have tried all possible combinations of events (CellSave, OnCellSave, ... ) and nothing gets fired.

What am I doing wrong here?


4 Replies 1 reply marked as answer

GJ Geir Jonsson March 4, 2021 10:33 AM UTC

I Have updated to 18.4.0.46 and this is still the same ... :/  .. anyone? 


RN Rahul Narayanasamy Syncfusion Team March 4, 2021 01:49 PM UTC

HI Geir, 

Greetings from Syncfusion. 

Query: Grid "Update" after editing cells only "selects" the grid but doesn't fire events expected - When I click "Update" in the toolbar, expecting the OnBatchSave to fire nothing happens except that the Grid component is selected (turns gray) 

We have validated your query and checked the reported problem in the mentioned version and also in latest version. We could not reproduce the reported problem at our end. While clicking Update button in the toolbar, the OnBatchSave event is triggered properly without any issues. Find the below sample for your reference. 


Could you please ensure the reported problem by upgrading to latest version? 

If you still facing the problem, then could you please share the below details. 

  • Reproduce the problem in the provided sample and revert back to us.
  • Whether did you performed any customization in Grid?
  • Share a simple reproduceable  sample if possible.

Regards, 
Rahul 


Marked as answer

GJ Geir Jonsson March 4, 2021 04:34 PM UTC

Comparing the two projects (The demo page didn't work when inserted into my project) .....  lead me to the solution.

The problem was that in the Startup.cs I was adding syncfusion with the script manager disabled.

services.AddSyncfusionBlazor(true);

Removing that "true" and falling back to the default "false" made the grid work again.

So, mystery solved :)  Thanks!


RN Rahul Narayanasamy Syncfusion Team March 5, 2021 02:02 PM UTC

Hi Geir, 

Thanks for the update. We are happy to hear that you have found the solution. 

From the provided details and you have enabled custom client side resource loading. To enable custom client side resource loading from CRG or CDN, you need to disable resource loading by AddSyncfusionBlazor(true) and load the scripts in the HEAD element of the ~/Pages/_Host.cshtml page. 

You can also resolve the reported problem by referring the below script reference in _Host.cshtml(in server-side) or index.html(in client side) file. Find the below code snippets for your reference. 

<head> 
    <meta charset="utf-8" /> 
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /> 
    <title>BlazorApp1</title> 
    <base rel='nofollow' href="~/" /> 
    <link rel="stylesheet" rel='nofollow' href="css/bootstrap/bootstrap.min.css" /> 
    <link rel='nofollow' href="css/site.css" rel="stylesheet" /> 
    <link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.2.44/styles/fabric.css" rel="stylesheet" /> 
   <script src="https://cdn.syncfusion.com/blazor/18.3.53/syncfusion-blazor.min.js"></script>  // refer this if you enabled AddSyncfusionBlazor(true) 
</head> 

Please get back to us if you need further assistance. 

Regards, 
Rahul 


Loader.
Up arrow icon