Hi all,
 
I and am playing with spreadhseets and very new to the API. 
Using the developers guide I can sucessfully add a row to any spreadsheet 
with existing data..
 
string[] values = new string[]{"aaa","bbb","ccc"};
AtomLink atomLink = 
worksheetEntry.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
ListQuery listQuery = new ListQuery(atomLink.HRef.ToString());
ListFeed listFeed = _spreadSheetService.Query(listQuery);

ListEntry existingRow = (ListEntry)listFeed.Entries.First();
ListEntry newRow = new ListEntry();

int count = 0;
foreach (ListEntry.Custom element in existingRow.Elements)
{
 ListEntry.Custom curElement = new ListEntry.Custom();
 curElement.LocalName = element.LocalName;
 curElement.Value = values[count];
 newRow.Elements.Add(curElement);
 count++;
}

ListEntry insertedRow = listFeed.Insert(newRow) as ListEntry;

My problem is that when I have a new (blank) spreadhseet listFeed.Entries above 
will be empty therefore the above code will fail.

How do I add a row to a blank spreadsheet?

Thanks!

 

Reply via email to