Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用ComboBox更新DataGridView?_C#_Winforms_Ado.net_Combobox - Fatal编程技术网

C# 如何使用ComboBox更新DataGridView?

C# 如何使用ComboBox更新DataGridView?,c#,winforms,ado.net,combobox,C#,Winforms,Ado.net,Combobox,仅当再次选择该行时才进行更新。如果移动并单击行,更新将落后于一行(上一行的更新,未选中).请更清楚地说明您面临的问题,因为我不知道您想说什么。如何在DataGridView中显示数据?您是直接使用BindingSource还是dbDataSet.mytb?DataGridView、ComboBox及其BindingSource、TableAdapters是通过从数据源拖放到表单上自动创建的。 private void tbComboBox_SelectedIndexChanged(object

仅当再次选择该行时才进行更新。如果移动并单击行,更新将落后于一行(上一行的更新,未选中).

请更清楚地说明您面临的问题,因为我不知道您想说什么。如何在DataGridView中显示数据?您是直接使用BindingSource还是dbDataSet.mytb?DataGridView、ComboBox及其BindingSource、TableAdapters是通过从数据源拖放到表单上自动创建的。
private void tbComboBox_SelectedIndexChanged(object sender, EventArgs e)
          {
 this.mytbTableAdapter.Fill(this.dbDataSet.mytb);
          }