views:

530

answers:

1

The first time I try to open a particular form many of the controls (those with anchors on the right side and/or the bottom) are shifted and my grids automatically regain all the columns from their datasource which (the columns) I had previously removed.

I have read elsewhere it is recommended to copy the 'good' designer code into the constructor after the InitializeComponent method. This doesn't seem to be a good long term solution, eg what if a user makes future design changes?

Any suggestions/workarounds? Is this a Visual Studio 2008 bug?

A: 

I found deleting the controls and adding them back in works. Not just cut and paste, but adding the controls back from scratch. This seems to be related to where to designer code is written in the InitialiseComponent method.

This link describes some issues with anchoring and derived forms: http://weblogs.asp.net/rweigelt/archive/2003/09/24/28984.aspx

ptutt