We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

TargetInvocationException for ButtonEdit control.

Thread ID:

Created:

Updated:

Platform:

Replies:

61161 May 18,2007 01:21 AM May 22,2007 08:08 PM Windows Forms 5
loading
Tags: Tools
Ravi
Asked On May 18, 2007 01:21 AM

Hi,

After i migrate my code from Syncfusion 4.3 to 5.1, I got the following exception when i try to run my application. Please help me to fix the problem.

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: BorderStyle value must be None
at Syncfusion.Windows.Forms.Tools.ButtonEdit.HandleEditBorderStyleChanged(Object sender, EventArgs e)
at System.Windows.Forms.TextBoxBase.OnBorderStyleChanged(EventArgs e)
at System.Windows.Forms.TextBoxBase.set_BorderStyle(BorderStyle value)

Thanks,
-Ravi.

Poly J [Syncfusion]
Replied On May 21, 2007 10:20 AM

Hi Ravi,

Thanks for your interest in Syncfusion products.
I am not able to reproduce the issue in our end. Could you please send me the CS file which using ButtonEdit Control in your application.

Best Regards,
Poly




Ravi
Replied On May 21, 2007 12:29 PM

Hi Poly,

In the InitializeComponent() method, iam getting the exception at "this.TextBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;" line.

Thanks,
Ravi.

Poly J [Syncfusion]
Replied On May 22, 2007 06:31 AM

Hi Ravi,

Thanks for the update.
In 4.3 version Button Edit Embedded text box uses windows form textbox control . In the Essential Studio latest version the Embedded textBox is changed to Syncfusion TextBoxExt control. Please change the BorderStyle to None and let me know if it is solve the issue.

Best regards,
Poly



Ravi
Replied On May 22, 2007 09:57 AM

Thanks Poly, it works. Is TextBoxExt control internally uses any border style. Do i need to add any extra code to make things to work. Because by default values in the Button edit control are not populating in v5.1. Following is the code which use to work perfectly with v4.3.

this.lookupBT = new Syncfusion.Windows.Forms.Tools.ButtonEditChildButton();
//
// lookupBT
//
this.lookupBT.ButtonAlign = Syncfusion.Windows.Forms.Tools.ButtonAlignment.Right;
this.lookupBT.ButtonEditParent = this;
this.lookupBT.ButtonType = Syncfusion.Windows.Forms.Tools.ButtonTypes.Browse;
this.lookupBT.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.lookupBT.Location = new System.Drawing.Point(100, 0);
this.lookupBT.Name = "lookupBT";
this.lookupBT.PreferredWidth = 24;
this.lookupBT.Size = new System.Drawing.Size(16, 22);
this.lookupBT.TabIndex = 1;
this.lookupBT.TabStop = true;
//
// customerLF
//
this.Buttons.Add(this.lookupBT);
this.Controls.Add(this.lookupBT);
this.Location = new System.Drawing.Point(120, 40);
this.Name = "customerLF";
this.ParentContainer = null;
this.SelectionLength = 0;
this.SelectionStart = 0;
this.ShowTextBox = true;
this.Size = new System.Drawing.Size(216, 22);
this.TabIndex = 1;
this.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TextBox.AutoSize = false;
this.TextBox.BorderStyle = System.Windows.Forms.BorderStyle.None; //Modified as you suggested.
this.TextBox.Location = new System.Drawing.Point(1, 2);
this.TextBox.Name = "";
this.TextBox.Size = new System.Drawing.Size(198, 18);
this.TextBox.TabIndex = 0;


Regards,
Ravi.

Murugan [Syncfusion]
Replied On May 22, 2007 08:08 PM

Hi Ravi,

ButtonEdit.TextBoxExt control is not using any BorderStyle internally. When ButtonEdit control is used, it is default to set TextBoxExt.BorderStyle = BordeStyle.None. Could you please provide us more details about the issue?

I have customized the ButtonEdit control, even I could see the default values in the TextBoxExt of the ButtonEdit control. Could you please modify the sample below to reproduce the issue as you mentioned?

[Sample]
http://websamples.syncfusion.com/samples/Tools.Windows/F61161/Main.htm

Thanks for your patience.

Regards,
Murugan P.S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;