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.

BarItem & DataBindings

Thread ID:





35875 Oct 12,2005 10:31 AM Oct 18,2005 07:03 AM Windows Forms 3
Tags: Tools
Mikaël Morvan
Asked On October 12, 2005 10:31 AM

Hi, When i want to add 2 dataBindings to 2 baritem, an exception occurs. The code is : this.bi_print.DataBindings.Clear(); this.bi_printPreview.DataBindings.Clear(); this.bi_print.DataBindings.Add("Enabled", form, "CanPrint"); this.bi_printPreview.DataBindings.Add("Enabled", form, "CanPrintPreview"); The exception is : Une exception non gérée du type ''System.ArgumentException'' s''est produite dans system.windows.forms.dll Informations supplémentaires : Deux liaisons de la collection vont être liées à la même propriété. It occurs because the dataBindings collection of each baritem is the same. So when i add a dataBinding to "bi_print" baritem, it''s added to "bi_printPreview" baritem. Why ? How can i solve this problem (i use version) ? Regards, Mikaël

Administrator [Syncfusion]
Replied On October 13, 2005 09:19 AM

Hi Mikael, Please implement the ICustomTypeDescriptor interface to support databinding for BarItems.I have attached a sample that illustrates this.Let me know if this meets your requirement. We appreciate your cooperation. Regards, Ebenezer.P


Mikaël Morvan
Replied On October 14, 2005 05:11 AM

Hi, Now, this code works fine : this.DataBindings.Add(new System.Windows.Forms.Binding("MenuItem:Print.Text", form, "Text")); this.DataBindings.Add(new System.Windows.Forms.Binding("MenuItem:PrintPreview.Text", form, "Text")); but this one not work : this.DataBindings.Add(new System.Windows.Forms.Binding("MenuItem:Print.Enabled", form, "CanPrint")); this.DataBindings.Add(new System.Windows.Forms.Binding("MenuItem:PrintPreview.Enabled", form, "CanPrintPreview")); I can''t use databinding with the enabled properties of baritems. How can i make baritem support this databinding ? Regards, Mikaël

Administrator [Syncfusion]
Replied On October 18, 2005 07:03 AM

Hi Mikael, I am afraid it is possible to databind only the text and tooltip properties of the BarItem. We appreciate your cooperation. Regards, Ebenezer.P


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.