Visual Studio Winform designer: Set DataBindings on current control BindingSource

会有一股神秘感。 提交于 2019-12-02 08:47:49

问题


I am creating a UserControl in Winforms, using Visual Studio 2013 designer. It contains a TextBox. I added a BindingSource (which DataSource property is set in code to a List).

When I click on the TextBox, look in the property window (F4), expand the "(DataBindings)" node and click on the "(Advanced)" button the Binding window opens.

In that window, there is no choice available in the Bindings list (beside Add). I Expected to find my BindingSource in that list.

Is it possible to get my custom BindingSource (added with Drag&Drop in the designer) available in that Binding window?


回答1:


You have to set the DataSource property on your BindingSource control, like so:

Your BindingSource control will now be available in the designer:



来源:https://stackoverflow.com/questions/22349162/visual-studio-winform-designer-set-databindings-on-current-control-bindingsourc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!