// Спуск строки
        private void MoveRowDown_Click(object sender, EventArgs e)
        {
            // Контроль
            if ((MainDataGrid.Rows.Count < 2) || (MainDataGrid.SelectedCells[0].RowIndex == MainDataGrid.Rows.Count - 1))
            {
                return;
            }

            DataTable table = (DataTable)MainDataGrid.DataSource;

            // Фиксация индекса
            int insertedIndex = MainDataGrid.SelectedCells[0].RowIndex + 2;

            // Добавление и заполнение строки
            table.Rows.InsertAt(table.NewRow(), insertedIndex);
            table.Rows[insertedIndex].ItemArray =
                (object[])table.Rows[insertedIndex - 2].ItemArray.Clone();

            // Удаление старой строки
            table.Rows.RemoveAt(insertedIndex - 2);

            // Переход на сдвинутую строку
            MainDataGrid.ClearSelection();
            MainDataGrid.Rows[insertedIndex - 1].Cells[0].Selected = true;
        }
        // Удаление строк
        private void DeleteRow_Click(object sender, EventArgs e)
        {
            // Контроль количества строк
            if (MainDataGrid.Rows.Count <= 2)
            {
                MessageBox.Show(Localization.GetText("NotEnoughRowsError", language), ProgramDescription.AssemblyTitle,
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            DataTable  table   = (DataTable)MainDataGrid.DataSource;
            List <int> indices = new List <int> ();

            // Индексирование удаляемого диапазона
            for (int i = 0; i < MainDataGrid.SelectedCells.Count; i++)
            {
                if (!indices.Contains(MainDataGrid.SelectedCells[i].RowIndex))
                {
                    indices.Add(MainDataGrid.SelectedCells[i].RowIndex);
                }
            }
            indices.Sort();

            // Удаление
            for (int i = 0; i < indices.Count; i++)
            {
                table.Rows.RemoveAt(indices[i] - i);
            }

            // Переход на заведомо оставшуюся строку
            if ((indices.Count != 0) && (MainDataGrid.Rows.Count != 0))
            {
                MainDataGrid.ClearSelection();
                if (indices[0] - 1 < 0)
                {
                    MainDataGrid.Rows[0].Cells[0].Selected = true;
                }
                else
                {
                    MainDataGrid.Rows[indices[0] - 1].Cells[0].Selected = true;
                }
            }
        }