Jump to content

Recommended Posts

Posted

Hi!,

 

I've created a new component, in constructor i set default properties

(Nothing in special)

 

******* public LookUpCentroContable() : base()

******* {***********

***********

*********** Properties.Columns.Add(new LookUpColumnInfo("IdCentro", 70, "Id."));

*********** Properties.Columns["IdCentro"].FormatType = Numeric;

*********** Properties.Columns.Add(new LookUpColumnInfo("Nombre", 250, "Nombre"));

*********** Properties.Columns.Add(new LookUpColumnInfo("CentroAbrev", 90, "Abreviatura"));

*********** Properties.PopupWidth = 410;

*********** Properties.NullText = "";

******* }

 

But when i drop this control on a form myForm.Designer.cs creates these lines automatically :-(

 

*********** //

*********** // lookUpCentroContable

*********** //

*********** this.lookUpCentroContable.Location = new System.Drawing.Point(128, 0);

*********** this.lookUpCentroContable.Name = "lookUpCentroContable";

*********** this.lookUpCentroContable.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {

*********** new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)});

*********** this.lookUpCentroContable.Properties.Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {

*********** new DevExpress.XtraEditors.Controls.LookUpColumnInfo("IdCentro", "Id.", 70, DevExpress.Utils.FormatType.Numeric, "", true, DevExpress.Utils.HorzAlignment.Default, DevExpress.Data.ColumnSortOrder.None),

*********** new DevExpress.XtraEditors.Controls.LookUpColumnInfo("Nombre", "Nombre", 250),

*********** new DevExpress.XtraEditors.Controls.LookUpColumnInfo("CentroAbrev", "Abreviatura", 90)});

*********** this.lookUpCentroContable.Properties.NullText = "";

*********** this.lookUpCentroContable.Properties.PopupWidth = 410;

*********** this.lookUpCentroContable.Size = new System.Drawing.Size(100, 20);

*********** this.lookUpCentroContable.TabIndex = 39;

 

And the result is these columns are setting twice, so it appears twice in execution :-(

 

How can I avoid these designer automatic initializations.

I supose i should move code from constructor to an override method based on Control, any idea?

 

Thanks in advance

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...