Hi,
I get this error message, when I try to delete from SfGrid with the CommandColumn (when a row contains " mark).
Newtonsoft.Json.JsonReaderException: After parsing a value an unexpected character was encountered: d. Path 'data.0.eTag', line 1, position 136.
Environment:
Platform: Syncfusion Blazor Webassembly (client side)
Version: 18.1.0.53
To reproduce: Run the sample (below) and click on the delete button
Current result: Row not deleted, the console shows the error message with stack trace
Expected result: The row deleted without errors
Workaround: It works, when I delete the row with a CommandButtonType.None Column and my custom handler code
Example code to reproduce:
@page '/'
@using Syncfusion.Blazor.Grids
<SfGrid DataSource="@list">
<GridEditSettings Mode="EditMode.Dialog" AllowAdding="true" AllowDeleting="true" AllowEditing="false" />
<GridColumns>
<GridColumn HeaderText="Id" Field=@nameof(EmployeeData.Id) IsPrimaryKey="true" />
<GridColumn HeaderText="FirstName" Field=@nameof(EmployeeData.FirstName) />
<GridColumn>
<GridCommandColumns>
<GridCommandColumn Type="CommandButtonType.Delete"
Title="Delete"
ButtonOption="@(new CommandButtonOptions() { CssClass="e-flat",
Content="Delete" })" />
</GridCommandColumns>
</GridColumn>
</GridColumns>
</SfGrid>
@code {
public class EmployeeData
{
public int Id { get; set; }
public string FirstName { get; set; }
public string Designation { get; set; }
public string eTag { get; set; }
}
public List<EmployeeData> list = new List<EmployeeData>()
{
new EmployeeData{ Id=1, FirstName="Adam", Designation="None", eTag="W/\"datetime'2020-05-31T18:53:18.21Z'\"" },
new EmployeeData{ Id=2, FirstName="Andy", Designation="None", eTag="W/\"datetime'2020-05-31T18:55:18.21Z'\"" },
};
}
Thank you!
Regards,
Peter