By Ger Cannoll - 10/19/2011
I just upgraded the DevEx Comntrols to 11.1 and since then I am getting a run time error on a Devex Subclassed Control
(Everything was working fine prior to the upgrade)
I have traced the Error (Object reference not set to an instance....) back to a Line on the .Designer.cs file :
((System.ComponentModel.ISupportInitialize)(this.txtTotalExposure.Properties)).BeginInit();
My Subclassed Code is (Which I have not changed)
// 31-03-11 Subclass form DevExpress Controls public class dxTextEdit : MicroFour.StrataFrame.UI.Windows.Forms.DevEx.TextEdit { private System.Drawing.Color originalBackgroudColour; protected override void OnEnter(EventArgs e) { //-- Run Base Class Code // XtraMessageBox.Show("this is a message in OnEnter of dcTextEdit"); base.OnEnter(e); //-- Save away original background color this.originalBackgroudColour = this.BackColor; // Mimic the VFP SelectOnEntry = .t. this.SelectAll(); //-- Set fields to be the maximum length of the database fields //-- For Memo (VarChar(Max) check for Mutiline..assumes Multiline is on for VarChar(Max) though // -----> TextEdit does not seem to have a propety called MultiLine or AutoAdjustMaxLength..GOC Modified SF code No MUltiLine though ?? if (this.BusinessObject == null ) { this.AutoAdjustMaxLength = false; } else { // XtraMessageBox.Show("dxTextEdit... before setting this.AutoAdjustMaxLength to true"); this.AutoAdjustMaxLength = true; } //-- Define the background color for the control.. maybe extend this to use a property later this.BackColor = Color.Aqua; } protected override void OnLeave(EventArgs e) { //-- Run the Base Code for the textbox base.OnLeave(e); //-- Reset back color to the default this.BackColor = this.originalBackgroudColour; } } // End dxTextEdit // 31-03-11 SubClas dxTextEdit for 0 decimal point numeric field public class dxTextEdit0D : dxTextEdit { protected override void OnEnter(EventArgs e) { base.OnEnter(e); this.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.Properties.EditFormat.FormatString = "###,###,###,##0"; // Allow dec point else it ignores it and 12.34 goes to 1234 this.Properties.DisplayFormat.FormatString = "###,###,###,##0"; this.Properties.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Numeric; this.Properties.Mask.EditMask = "n00"; } } // End dxTextEditN0
|
By Ger Cannoll - 10/19/2011
OK . Seem to have got this sorted.
Even though I 'thought' I had copied the Recompiled SF Inherited UI.dll to the GAC, it does not look as if it had been copied. So I removed the existing one, and recopied if to the GAC from the Project Folder. Error is gone away now !!
|
By Edhy Rijo - 10/20/2011
Hi Gerard,
Yeap, I've seen errors like that before when rebuilding SF source. Make sure when you are updating the SF source that any project that uses those libraries are closed.
|
By Zoltan Riss - 10/27/2011
I checked while updating SF source and closed all the projects that used the libraries.But still it shows an error message while updating SF source...Can anyone point out where am I going wrong.
|
By Ger Cannoll - 10/27/2011
Hi Zoltan.
Are you getting a run time error in relation to new version of Dev Express with Modifified SF Source Code ? . If so, what fixed it for me, was recompiling the SF Source Code (for DevExpress Wrappers) and SPECIFICALLY COPYING THE SF DevExpress .DLL to the GAC (By first deleting the Exisitng GAC DLL, then opening two concurrent versions of Windows Explorer and Dragging and Dropping the DLL from the compiled folder into the GAC folder)
|