Same name of Column in different datagridview

0

Good afternoon,

I have 2 datagridview, but when I add a column in the second datagrid that is already in the first datagrid I get the following:

It is possible that you can not have 2 columns with the same name in different datagrid, taking into account that the first datagrid has no relationship with the second datagrid.

Thanks for your help.

    
asked by Guivan 30.08.2017 в 00:48
source

1 answer

0

If possible, the error occurs because every time you create a column the designer creates an instance of the DataGridViewColumn class with the name of the column in your form.

You can name them Poli_Codigo1 and Poli_Codigo2 and the property HeaderText name both as Poli_Codigo and it will work as you need.

To avoid confusion with your variables you can name them according to the standard using the name of the class Poli_Codigo1DataGridViewColumn or simply Poli_Codigo1Column.

    
answered by 30.08.2017 / 02:03
source