How to add a simple header row on a programmaticaly created worksheet via Google Spreadsheet API? Its very difficult to understand their doc which has only mentioned how to add a row on already created header row. If a cell based feed is used for the first time for adding a header row,
// Fetch the cell feed of the worksheet.
CellQuery cellQuery = new CellQuery(worksheet.CellFeedLink);
CellFeed cellFeed = service.Query(cellQuery);
// Iterate through each cell, updating its value if necessary.
foreach (CellEntry cell in cellFeed.Entries)
{
if (cell.Title.Text == "A1")
{
cell.InputValue = "name";
cell.Update();
}
else if (cell.Title.Text == "B1")
{
cell.InputValue = "age";
cell.Update();
}
}
This code doesn’t work as cellFeed.Entries is 0, thus control doesn’t ever enter the for loop.
I have already added a worksheet with (4) rows and (10) columns. But how do I enter a simple header row (as a column) first and then other rows (as values in these columns)?
I know already few questions has been asked but non of them have answers, it is so frustrating and difficult to understand what is this API so complicated to implement?
the answer is :
Then the rows can be added below as per the doc matching the above header rows.