0
When you add a column to DataGridView
, you create an object DataGridViewColumn
, which in your code is called codigo
(there on the property Name
). Then, you can change any object value.
Example:
string p = "id_exemplo";
codigo.DataPropertyName = p;
is also equivalent to:
string p = "id_exemplo";
dataGridView1.Columns[codigo.Name].DataPropertyName = p;
I recommend reviewing the names of variables and properties.
pass parameter or rename property ? on this screen, just change... you want via code ? if yes, you have to change the property of Datagridviewcolumn, since you are handling a...
– Rovann Linhalis
So I want to "put" the value of a variable to change the property, and depending on that "value" change the property
– vinibsc