winform 数据绑定基础

1. One control can either has its own BindingContext, or retrieves one from its parent container(e.g. Form, ContainerControl, etc.). So some controls might share one same BindingContext.
2. Given a pair of dataSource and dataMember (can be null or string.Empty), BindingContext returns exclusive BindingManagerBase instance.
3. If two controls have the same [dataSource, dataMember] bound to its property, the values on user interface are kept synchronized.
4. If you don't expect the 3th situation (out of sync), you can set control's BindingContext to distinct instances.

参考: https://www.codemag.com/article/0409041/A-Look-Under-the-Hood-of-Windows-Forms-Data-Binding

转载请注明出处
原文地址:https://www.cnblogs.com/godlessspirit/p/15216179.html