BindableAttribute、Combobox、Selectedvalue 属性 - WinForms
我从组合框 (WinForms) 派生,并为 Selectedvalue 属性提供新的实现。
它按原样工作正常,但对 selectedvalue 属性的任何更改都不会更新绑定到同一“绑定上下文”的其他控件以相应地更改其值。
我确实尝试将 BindableAttribute(true) 添加到属性中,但它仍然不会触发其他链接控件的值更改。
控件的 DataBindings.add(...) 已全部设置完毕。 其他控件也绑定到同一数据源上的相同数据。
任何想法我做错了什么。
I am deriving from combobox (WinForms) and am providing a new implementation for the Selectedvalue property.
It works fine as is, but any change to the selectedvalue property is not updating other controls bound to the same "binding context" to change their values accordingly.
I did try adding the BindableAttribute(true) to the property, but still it does nottrigger the change in value to the other linked controls.
The control's DataBindings.add(...) is all set up. And other controls are also bound to the same data filed on the same datasource.
Any ideas what i am doing wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否调用了基类的重写方法的实现? 未能调用基类实现可能会意外地绕过触发各种事件管道的代码。
Have you called your base class' implementation of overridden methods? It's possible that failing to call the base class implementation is accidentally circumventing the code that fires various event plumbing.