I’ve been using Developer Express components with VS.NET 2005 (beta 1) for a while, but nearly always in forms that I had previously created with VS.NET 2003. Now, suddenly some problems showed up when these old forms were edited, specifically with XtraGrids and XtraEditors on them. These problems were quite severe, as the VS designer would simply refrain from persisting all properties that are stored in “inner objects” of the main component.

This concept is used all over the DX libraries, for example for the Properties property in the XtraEditors library and the Styles and Views properties of the GridControl. A single modification in the designer would trigger recreation of the InitializeComponent method, thereby effectively destroying the form. The funny (and good) thing about this is that I found the necessary modifications in the source code files already. As far as I know, DX distribute compiled versions for VS.NET 2005 to the customers that need them, and I guess these versions are actually compiled with the modifications enabled. Using the standard distribution, on the other hand, these modifications are not active by default!

What you need to do is this: Add a constant DXWhidbey to the constant list of the configuration you are compiling for, for all the projects in the DX source code. If you do this within VS, it should look like this (for the Debug configuration):

dxwhidbeyide.png

You can also edit the .csproj file yourself (or use search/replace), in that case the changed line should look like this:

<DefineConstants>DEBUG;TRACE;DXWhidbey</DefineConstants>

Recompile all the libraries and voila: Working persistence in VS.NET 2005.