Hi
Working with the Demo Batch Editing and Update and Cancel toolbar items. Is there any way to enable the toolbar items(Update and Cancel) once we start editing a cell? now it gets enabled when you unfocus or go to another cell/
|
<SfGrid ID="Grid" @ref="GridInstance" 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>
<GridEvents OnCellEdit="CellEdit" TValue="Order"></GridEvents>
. . . .. .
</SfGrid>
@code{
SfGrid<Order> GridInstance { get; set; }
public List<Order> Orders { get; set; }
public async Task CellEdit(CellEditArgs<Order> Args)
{
// Grid_update - denotes Grid for Grid ID
await GridInstance.EnableToolbarItemsAsync(new List<string>() { "Grid_update", "Grid_cancel" }, true);
}
|
Hi thanks for the answer, I meant something like CellValueChange, so the buttons get enabled when you delete the current cell content or start typing, not when the edition mode starts.
I think is possible with templates but when I want to use the simple column and its EditType.
I have two problems I'd like to point out:
1. The names of the toolbar items must match the name of the items in await GridInstance.EnableToolbarItemsAsync(new List<string>() { "Grid_update", "Grid_cancel" }, true);
They should be "Update" and "Cancel" not "Grid_update" and "Grid_cancel".
2. It should probably be mentioned that once you set the toolbar items enabled or disabled they no longer behave normally by disabling when something is saved or enabling when something is edited. You have now taken complete control of that and there is no way to hand it back to the grid.
Hi Kerry,
Greetings from Syncfusion support.
From your query, we would like to inform you that, we’ll set toolbar item name
similar to the Grid Id. This will help us to easily identify and track the
toolbar item when working with multiple grids in a single project.
Regards,
Sarvesh