Hi SyncFusion
Usually I wouldn't ask - but I spend a fair few hours on your forums looking for a solution.
I want to be able to delete many records simultaneously from a grid.
This is the column
<GridColumn Visible="editinggrid" Type="ColumnType.CheckBox" Width="20"></GridColumn>
AllowSelection is true,
Mode is Mode="EditMode.Batch"
GridSelectionSettings Type is "SelectionType.Multiple"
This is the event that fires when Delete is clicked from the toolbar
<GridEvents OnBatchDelete="BatchDelete" TValue="ResourceForGridDTO"></GridEvents>
public async void BatchDelete(BeforeBatchDeleteArgs<ResourceForGridDTO> args)
{
ResourceLibraryDTO resourcelibrary = await apiService.GetResourceLibraryAsync(args.RowData.ResourceId, library.LibraryId);
var userId = await ProtectedLocalStore.GetAsync<Guid>("userId");
resourcelibrary.Void = true;
resourcelibrary.ModifiedBy = userId;
await apiService.UpdateResourceLibrary(resourcelibrary);
await ShowSuccessToast("Success", "Successfully removed the resource"); }
This works for one record, but not all the selected records.
I can't for the life of me figure out how to do this, I tired var selectedRecords = ResourcesGrid.GetSelectedRows(); (the grid is @ref to ResourcesGrid)
But it can't find any selected rows.
Help or a general steer in the right direction would be highly appreciated
John