<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" ShowConfirmDialog="false" ... Mode="EditMode.Batch"></GridEditSettings>
|
<SfButton OnClick="Cancel" Content="Cancel"></SfButton>
<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"></GridEditSettings>
<GridColumns>
. . . . . .
</GridColumns>
</SfGrid>
@code{
SfGrid<Order> Grid { get; set; }
public List<Order> Orders { get; set; }
public bool enable { get; set; } = true;
public void Cancel()
{
Grid.EditSettings.ShowConfirmDialog = false; // to disbale the warning
StateHasChanged();
Grid.CloseEdit(); // to closing the editing form
Grid.EditSettings.ShowConfirmDialog = true; // enable the warning
StateHasChanged();
} |