private void CellCollection_Inserted(int index, object value)
{
//Only Spreadsheet documents are automaticaly resized
//not needed if the file is loaded (right order!);
if (this.Document is SpreadsheetDocument
&& !this.Document.IsLoadedFile)
{
if (this.Node.ChildNodes.Count == index)
this.Node.AppendChild(((Cell)value).Node);
else
{
XmlNode childNode = this.Node.ChildNodes[index];
this.Node.InsertAfter(((Cell)value).Node, childNode);
}
Row_OnRowChanged(this.GetRowIndex(), this.Cells.Count);
}
else
this.Node.AppendChild(((Cell)value).Node);
}