> On Wed, 30 Jan 2008 08:37:59 -0800 (PST), Crazy Cat
>
[quoted text clipped - 20 lines]
> What I finally did was to create a subclass of DataGridView and set
> AutoGenerateColumns = False in the constructor.
Thanks for your response Jack.
I tried this and yet it is still autogenerating the columns. It must
be something I'm doing.
I looked at my code and the only thing I can put it down to is that I
dynamically set the datasource
in the code, but I set autogeneratecolumns to false in the constructor
of the derived class and for
good measure in the grid. In design view I deleted the extraneous
columns, started the application
and all was good. As soon as I stopped debugging I notice that
magically the columns have been regenerated
in design mode.
Crazy Cat - 30 Jan 2008 20:11 GMT
> > On Wed, 30 Jan 2008 08:37:59 -0800 (PST), Crazy Cat
>
[quoted text clipped - 35 lines]
> magically the columns have been regenerated
> in design mode.
OK, this time I'm pretty sure it's nothing I'm doing. In design mode I
delete the extraneous columns. When I close the form and reopen it in
the designer the columns have been autogenerated. This is only
happening on one datagrid in my application.
WHAT THE HELL?
Sign me,
FRUSTRATED
Crazy Cat - 30 Jan 2008 20:30 GMT
> > > On Wed, 30 Jan 2008 08:37:59 -0800 (PST), Crazy Cat
>
[quoted text clipped - 46 lines]
>
> FRUSTRATED
OK, I found the solution --
Do not set DataSource and DataMember at design time -- set them at
runtime and all is fine.
Actually you might want to set them at design time to get the bindings
for your columns, but after setting the bindings CLEAR OUT THE
Datasource and Datamember properties and set them at runtime.