Databinding Exception Cannot format the value to the desired type hard to debug

早过忘川 提交于 2019-12-06 16:50:25

Try enabling formatting

this.myTextBox1.DataBindings.Add(new System.Windows.Forms.Binding("EditValue", this.bindingSource1, "MyProperty", true));

Notice the true-parameter

Setting this property to true also enables error-handling behavior and causes the BindingComplete event to be raised. The handler of this event can take the appropriate action, based on the success, error, or exceptions in the binding process, by examining the BindingCompleteState property of the BindingCompleteEventArgs parameter.

http://msdn.microsoft.com/en-us/library/system.windows.forms.binding.formattingenabled.aspx

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