Run time error on DevEx Subclasses TextBox


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)Advanced StrataFrame User (628 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
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


 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search