How can I pass a parameter there? For example changing the id_inss to id_example?
I found no way to do it.
When you add a column to DataGridView
, you create a DataGridViewColumn
object, which in your code is called codigo
(there in the Name
property). Then you can change any value of the object.
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.