开发者

Winforms - a strange problem a with simple binding

It's hard for me to clearly describe my problem but I'll try. I have a UserControl1 which contains UserControl2 which contains several WinForms controls (most of them DevExpress). I do simple binding to these controls to my datatable fields. So far everything works fine. When I move the focus to a record in the table (by navigating in a grid rows for example) the binding works great, the concurrenmcy manager moves the cursor and everything reflects right in the bou开发者_如何学Cnded controls.

The problem starts when I add new user UserControl3 above UserControl2 and make UserControl2.Visible = false. Now UserControl3 is shown and UserControl2 exists but not shown. Now when I set UserControl2.Visible = true to show it again the simple binding stops working! I navigate in the grid but either the ConcurrencyManager stops working or the simple binding becomes disconnected.

My question: Are there any known issues/ best practices with the binding & concurrency manager?

Thanks a lot,

Adi Barda


I found the answer. The guys from devexpress helped me and now I know that in order to succeed with binding one should use the BindingSource object and not use directly the dataset/datatable objects. This solved all my binding problems. I beleive the BindingSource simply working correctly with the concurrency manager and the bindingContext objects.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜