I want the following output:
But I receive the following result:
I followed the instructions on this SO question:
How to Change color of range in google sheets api v4 in .net
But this code is bold on all rows and columns of the sheet.
How can I solve this problem? My Code is:
var userEnteredFormat = new CellFormat()
{
TextFormat = new TextFormat()
{
Bold = true,
FontSize = 12
}
};
BatchUpdateSpreadsheetRequest batchupdateCell = new BatchUpdateSpreadsheetRequest();
//create the update request for cells from the first row
var updateCellsRequest = new Request()
{
RepeatCell = new RepeatCellRequest()
{
Range = new GridRange()
{
SheetId = sheetId,
StartColumnIndex = 0,
StartRowIndex = 0,
EndColumnIndex = 28,
EndRowIndex = 1
},
Cell = new CellData()
{
UserEnteredFormat = userEnteredFormat
},
Fields = "UserEnteredFormat(TextFormat)"
}
};
batchupdateCell.Requests = new List<Request>();
batchupdateCell.Requests.Add(updateCellsRequest);
SpreadsheetsResource.BatchUpdateRequest bur = service.Spreadsheets.BatchUpdate(batchupdateCell, SheetId);
BatchUpdateSpreadsheetResponse responseUpdate3 = bur.Execute();

