在Winforms应用程序中单击按钮更改数据源

时间:2013-12-12 11:44:41

标签: c# winforms datagridview

我有一个datagridview( dataGridView1 )从名为rentBindingSource的mdb数据源中提取信息,如何通过点击按钮从hireBindingSource中提取信息,即

    private void viewHire_Click(object sender, EventArgs e)
    {
        // refresh datagrid view to load stuff from hireBindingSource
    }

1 个答案:

答案 0 :(得分:1)

试试这个:

    private void viewHire_Click(object sender, EventArgs e)
    {
        dataGridView1.DataSource = hireBindingSource;
    }