Hi Salvatore,
Thanks for contacting Syncfusion support.
Query: “I set the value of AllowAdding = "false" but despite this if I press the "INS" key the grid adds a new row”
We have analyzed the reported query and we are able to reproduce the behavior at our end also. We suggest you to overcome the issue by prevent the default action in OnActionBegin event of Grid using Args.Cancel property.
Refer the below code example.
|
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315">
<GridEditSettings AllowAdding="false" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>
<GridEvents OnActionBegin="OnActionBegin" TValue="Order"></GridEvents>
</SfGrid>
@code{
SfGrid<Order> Grid { get; set; }
public List<Order> Orders { get; set; } public void OnActionBegin(ActionEventArgs<Order> Args) { if (Args.RequestType == Syncfusion.Blazor.Grids.Action.Add && !Grid.EditSettings.AllowAdding) { Args.Cancel = true; } }
|
Kindly download the sample from below
Refer the below documentation for your reference
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan