private void buttonUpd_Click(object sender, EventArgs e)
 {
     if (dataGridViewElements.SelectedRows.Count == 1)
     {
         var form = new FormElement
         {
             Id = Convert.ToInt32(dataGridViewElements.SelectedRows[0].Cells[0].Value)
         };
         form.ShowDialog();
     }
 }
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            var form = new FormElement();

            form.ShowDialog();
        }