示例#1
0
 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());
     }
 }
示例#2
0
        /// <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());
            }
        }