예제 #1
0
        public void InsertNewRowToLast(bool not_update_focused_control, string column = null, object value = null)
        {
            models.db.Row row = table_.NewRow();
            if (InitInsertedRow != null)
            {
                InitInsertedRow(row);
            }
            if (IsValidNewRow != null)
            {
                if (IsValidNewRow(row) == false)
                {
                    return;
                }
            }
            table_.Insert(row);

            models.db.Row insertedRow = table_.LastInsertedRow();

            if (column != null)
            {
                insertedRow.Set(column, value);
            }

            if (grid_.SelectedRowNo == grid_.RowCount - 1 && grid_.NewRowIsVisible)
            {
                grid_.SelectedRowControl.SetRowData(insertedRow, true);
                grid_.SelectedRowControl.IsNewRow = false;
            }
            grid_.DataCount = grid_.DataCount + 1;
        }