单击按钮时加载表datagridview [英] load table datagridview on button click
本文介绍了单击按钮时加载表datagridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
i当我点击一个按钮时,我试图在datagridview中加载一个表。
这是我的代码:
Hello,
i am trying to load a table in a datagridview when i click a button.
This is my code:
private void btn_klant_Click(object sender, EventArgs e)
{
dgv_main.DataSource = dataset_tables_all1;
this.klantTableAdapter1.Fill(this.dataset_tables_all1.Klant);
dgv_main.Refresh();
}
我做错了什么?
谢谢。
What am i doing wrong?
Thanks.
推荐答案
在绑定第一行和第二行的数据更改序列之前,您正在为表提供数据源我认为这样可行
you are providing datasource to the table before binding the data change sequence of 1st and 2nd line I think this will work
谢谢,这是我现在的代码:
Thanks, This is my code now:
private void btn_klant_Click(object sender, EventArgs e)
{
dgv_main.DataSource = klantBindingSource;
this.klantTableAdapter1.Fill(this.ds_klant.Klant);
dgv_main.Refresh();
}
有效!
It works!
这篇关于单击按钮时加载表datagridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文