I have a DataGridView placed on a Windows Form and a Button inside the datagridview.
Now I want to change the text of a button on cell value basis.
How can i do it?
I have a DataGridView placed on a Windows Form and a Button inside the datagridview.
Now I want to change the text of a button on cell value basis.
How can i do it?
cast the Cell as a DataGridViewButtonCell and use it as you wish..
var BtnCell = (DataGridViewButtonCell)YourDataGridView.Rows[yourindex].Cells[cellindex];
BtnCell.Value = "New Button Value";
From MSDN:
You can set UseColumnTextForButtonValue
property value of true displays to the Text property value on the cells button.