C# Datagridview - Turn off AutoGenerateColumns when binding to XML file?

Goober picture Goober · Jul 13, 2009 · Viewed 8.5k times · Source

I am binding an XML file to a DataGridView. I don't want the columns to be auto-generated, in fact I want to generate them myself. Is there a way of turning off the auto generating columns feature and be able to programmatically create the columns myself?

Answer

ozczecho picture ozczecho · Jul 13, 2009
Datagridview1.AutoGenerateColumns=false