I've got a subclass of DataGridView that adds all the columns it needs in it's own constructor, but when I use this component in the VS designer it insists on generating code to add the same columns on top of the ones added in the component constructor. How do I force it to not generate code for columns it already finds populated inside a datagridview?
views:
10answers:
2
A:
You need to turn off autogeneration of columns before binding your datasource:
datagridview.AutoGenerateColumns = false;
datagridview.DataSource = mydatasource;
cdkMoose
2010-02-17 17:47:48
Sorry, just noticed you said the designer was creating the columns. My answer would be applicable only at binding time.
cdkMoose
2010-02-17 17:50:34
A:
Answered here: http://stackoverflow.com/questions/530176/how-do-you-prevent-the-visual-studio-designer-auto-generating-columns-in-a-datagr
ArildF
2010-10-04 12:21:08