没什么可说的,DataGridView可以绑定DataSet,也可以绑定DataTable。直接设置DataSource属性。

DataSet dataSet = new DataSet();
dataGridView1.DataSource = dataSet;
dataGridView1.DataSource = dataSet.Tables[0];


设置DataGridView的Column属性就可以决定哪一列显示的数据。

Column1.DataPropertyName = "ID"

 

相关文章:

  • 2022-12-23
  • 2022-02-08
  • 2022-01-05
  • 2022-02-08
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2022-02-08
  • 2022-02-28
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
相关资源
相似解决方案