How to delete not only datagrid rows, but also columns from header c #?

1

I'm doing this to erase the rows of my datagrid.Rows.Clear (); this erases the rows to me, but it leaves me the headings and I also want to erase the columns, how do I do it?

the rows and columns are added by code datagrid.rows.add (), not filled with datasource and database.

Thank you.

    
asked by Manny 05.12.2018 в 19:40
source

1 answer

1

try this. if you say that you did not add it through a datasource

dataGridView1.Columns.Clear();
    
answered by 05.12.2018 / 19:48
source