Bindingsource绑定功能使用.docVIP

  • 2
  • 0
  • 约8.49千字
  • 约 5页
  • 2016-09-20 发布于重庆
  • 举报
Bindingsource绑定功能使用

下面的代码示例演示如何使用 BindingSource 组件,将三个控件(两个文本框控件和一个 DataGridView 控件)绑定到 DataSet 中的同一列。 该示例演示如何处理 BindingComplete 事件,并确保当一个文本框的文本值更改时,会用正确的值更新其他文本框和 DataGridView 控件。 数据同步 // Declare the controls to be used. private BindingSource bindingSource1; private TextBox textBox1; private TextBox textBox2; private DataGridView dataGridView1; private void InitializeControlsAndDataSource() { // Initialize the controls and set location, size and // other basic properties. this.dataGridView1 = new DataGridView(); this.bindingSource1 = new BindingSource(); this.textBox1 = new TextBox();

文档评论(0)

1亿VIP精品文档

相关文档