private void AppendRow(TableRowModel theRow) { Rows.Add(theRow); this.rowCount++; if (theRow.Cells.Count == Columns.Count) { return; } for (var z = 0; z < Columns.Count; z++) { theRow.AddCell(new TableCellModel()); } }
/// <summary> /// Add a row to the table. /// </summary> /// <param name="selectedRowIndex"></param> /// <param name="theRow">The new row.</param> public void AddRowAfter(int selectedRowIndex, TableRowModel theRow) { if (selectedRowIndex < 0 || selectedRowIndex >= Rows.Count) { throw new ArgumentOutOfRangeException(nameof(selectedRowIndex)); } Rows.Insert(selectedRowIndex, theRow); this.rowCount++; if (theRow.Cells.Count == Columns.Count) { return; } for (var z = 0; z < Columns.Count; z++) { theRow.AddCell(new TableCellModel()); } }