示例#1
0
 private void bunifuImageButton1_Click(object sender, EventArgs e) //Добавить магазин
 {
     successLabel.Visible = false;
     SearchDataGrid.Rows.Add("Семья");
     for (int i = 0; i < SearchDataGrid.Rows.Count; i++)
     {
         for (int j = 0; j < SearchDataGrid.Columns.Count; j++)
         {
             SearchDataGrid.Rows[i].Cells[j].ReadOnly = true;
         }
     }
     SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[1].ReadOnly = false;
     SearchDataGrid.CurrentCell = SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[1];
     SearchDataGrid.BeginEdit(true);
 }
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            errorLabel.Visible = false;
            SearchDataGrid.Rows.Add();
            for (int i = 0; i < SearchDataGrid.Rows.Count; i++)
            {
                for (int j = 0; j < SearchDataGrid.Columns.Count; j++)
                {
                    SearchDataGrid.Rows[i].Cells[j].ReadOnly = true;
                }
            }
            //SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[0].ReadOnly = false;
            //SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[1].ReadOnly = false;
            //SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[2].ReadOnly = false;
            //SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[3].ReadOnly = false;
            //SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[4].ReadOnly = false;

            SearchDataGrid.CurrentCell         = SearchDataGrid.Rows[SearchDataGrid.Rows.Count - 1].Cells[0];
            SearchDataGrid.CurrentRow.ReadOnly = false;
            SearchDataGrid.BeginEdit(true);
        }