How can I change the value from all cells in DataGridView Windows Forms? I want to change directly in Windows Forms, like typing directly in the cell
I have a table like:
AA BB CC
--------------
1 aa ac
2 bb fd// I type here and change the value to kk
Code:
DataGridViewTextBoxColumn AA= new DataGridViewTextBoxColumn();
MsgIDHex.HeaderText = "AA";
MsgIDHex.DataPropertyName = "AA";
DataGridViewTextBoxColumn BB= new DataGridViewTextBoxColumn();
MsgIDHex.HeaderText = "BB";
MsgIDHex.DataPropertyName = "BB";
DataGridViewTextBoxColumn CC= new DataGridViewTextBoxColumn();
MsgIDHex.HeaderText = "CC";
MsgIDHex.DataPropertyName = "CC;
dataGridView1.DataSource = result;
dataGridView1.Columns.AddRange(AA, BB, CC};
Should I do something with DataGridViewTextBoxEditingControl?
You can simply do this (assuming that you want to change one value programmatically):
And how to enable editing of certain cell was already explained here.