9.2. How to use DevExpress controls in .NET Edition?
To use DevExpress controls, you should add a reference to the ActiveQueryBuilder.DevExpressControlFactory.dll file to your project or you may simply put the .dll near by your executable file. In the Main() function of your application, before any form creation, set up the DevExpress usage and turn on the QueryBuilder.UseDevExpressControls static property:
DevExpress.Skins.SkinManager.EnableFormSkins(); ActiveDatabaseSoftware.ActiveQueryBuilder.QueryBuilder.UseDevExpressControls = true;
Additionaly you can set the QueryBuilder.OverrideDevExpressThemeColors static property to True to use colors settings of the component instead of using colors from the current DevExpress theme.
Working with Visual Basic, you should use the My.Application.Startup event.
Your project must refer to DevExpress.Data.*, DevExpress.Utils.*, DevExpress.XtraEditors.*, DevExpress.XtraGrid.* and DevExpress.XtraTreeList.* assemblies and the ActiveDatabaseSoftware.DevExpressControlFactory2.dll.
If you have the "Failed to call GetCustomTreeView() method from DevExpressControlFactory" error, please check the following:
1. Make sure that you have the same DevExpress controls version as referred by the DevExpressControlFactory assembly. We are strive to refer to the latest DevExpress version, but there could be a small gap between the latest and the referred version. If you have a newer version of DevExpress controls, you can override version binding as described in the previous article.
2. If you refer to the same version of DevExpress assemblies, but still have this problem, please set the "Copy Local" property of referred DevExpress and Active Query Builder assemblies to True.
Note that the Professional .NET Subscription is shipped with the source code of DevExpress controls factory assembly, even if you didn't purchase the Full Source Code option, so you can recompile it with any DevExpress controls version that you have, considering that no changes were made in the DevExpress controls API since that time.