Hi,
I think databinding and tooltip is not working.
I have added the ToolTip control to the form. On a textbox in databinding properties I have bound the ToolTip to a text field in my bindingsource. When i run the program I get an error message:
Cannot bind to the property ‘ToolTip’ on the target control.
Parameter name: PropertyName
Best regards,
Wilfred
Controls don’t have a “ToolTip” property. You see it in the designer because of the ToolTip component which is a property extender (System.ComponentModel.IExtenderProvider). It’s similar to the other extenders we have: Bubbles, Animation, StyleSheet, all panels, etc. These components add properties to other controls at design time.
At runtime you can set those properties using the component:
this.toolTip.SetToolTip(this.button, “Test”);
For data binding you need an actual property. You could add a property string ToolTip { get; set; } and in the setter get the form using FindForm(), get the tooltip extender and set the value. Another way is to extend the wisej controls like the sample attached and code below:
public class MyButton : Button { [DefaultValue(null)] public string ToolTip { get { return this._toolTip; } set { if (this._toolTip != value) { this._toolTip = value; Update(); } } } private string _toolTip; protected override void OnWebRender(dynamic config) { base.OnWebRender((object)config); config.toolTipText = this.ToolTip; } }
Please login first to submit.