how to insert value into DataGridView Cell?

前端 未结 5 1786
失恋的感觉
失恋的感觉 2021-02-05 14:24

I have DataGridView (that hold any DataBase)

I want to insert any value into any Cell (and that this value will save on DataBase)

How t

5条回答
  •  忘了有多久
    2021-02-05 14:39

    For Some Reason I could Not add Numbers(in string Format) to the DataGridView But This Worked For Me Hope it help someone!

    //dataGridView1.Rows[RowCount].Cells[0].Value = FEString3;//This was not adding Stringed Numbers like "1","2","3"....
    DataGridViewCell NewCell = new DataGridViewTextBoxCell();//Create New Cell
    NewCell.Value = FEString3;//Set Cell Value
    DataGridViewRow NewRow = new DataGridViewRow();//Create New Row
    NewRow.Cells.Add(NewCell);//Add Cell to Row
    dataGridView1.Rows.Add(NewRow);//Add Row To Datagrid
    

提交回复
热议问题