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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

TargetInvocationException for ButtonEdit control.

Thread ID:





61161 May 18,2007 05:21 AM UTC May 23,2007 12:08 AM UTC WinForms 5
Tags: Tools
Asked On May 18, 2007 05:21 AM UTC


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)


Poly J [Syncfusion]
Replied On May 21, 2007 02:20 PM UTC

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,

Replied On May 21, 2007 04:29 PM UTC

Hi Poly,

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


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

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,

Replied On May 22, 2007 01:57 PM UTC

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.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;


Murugan [Syncfusion]
Replied On May 23, 2007 12:08 AM UTC

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?


Thanks for your patience.

Murugan P.S


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon