C# Winform DataGridView添加數據

C# Winform DataGridView添加數據

在這裏插入圖片描述

   private void btnAddData_Click(object sender, EventArgs e)
   {
       int i = this.BatchManagement.Rows.Add();
       this.BatchManagement.Rows[i].Cells[0].Value = i+1;
       this.BatchManagement.Rows[i].Cells[1].Value = "number" + " " + i+1;
       this.BatchManagement.Rows[i].Cells[2].Value = "10086" + " " + i+1;
   }
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章