Thank you for reading it :) Im using Blazor server and Google.Apis.Sheets.v4. I am trying to delete columns in a sheet with this code:
serviceSheet = new SheetsService(new Google.Apis.Services.BaseClientService.Initializer()
{
HttpClientInitializer = credentialSheet,
ApplicationName = ApplicitionNameSheet
});
public void DelteColumns(string ID, int start, int end)
{
Request RequestBody = new Request()
{
DeleteDimension = new DeleteDimensionRequest()
{
Range = new DimensionRange()
{
SheetId = 0,
Dimension = "COLUMNS",
StartIndex = start,
EndIndex = end
}
}
};
List<Request> RequestContainer = new List<Request>();
RequestContainer.Add(RequestBody);
BatchUpdateSpreadsheetRequest DeleteRequest = new BatchUpdateSpreadsheetRequest();
DeleteRequest.Requests = RequestContainer;
SpreadsheetsResource.BatchUpdateRequest Deletion = new SpreadsheetsResource.BatchUpdateRequest(serviceSheet, DeleteRequest, ID);
Deletion.Execute();
}
But for this I need SheetID for DeleteDimensionRequest. I have only 1 sheet in the spreadsheet, but his SheetID isnt 0. And I get error that there is no grid with index 0. I could not find a way to get the SheetId. Could you please help me? Maybe you can give me at least direction in which I can google :)