DataGridView如何进行数据绑定?
下面是我的代码,老是不能在DataGridView中显示数据,请看看是什么问题
DataTable dt = new DataTable();
dt.Columns.Add( "RegionNumber ");
dt.Columns.Add( "RegionDescription ");
DataRow newRow = dt.NewRow();
newRow[0] = "1 ";
newRow[1] = "测试区域 ";
dt.Rows.Add(newRow);
dataGridView_RegionList.DataSource = dt;
------解决方案--------------------例如:
this.fFileIDDataGridViewTextBoxColumn.DataPropertyName = "fFileID ";
this.fFileIDDataGridViewTextBoxColumn.HeaderText = "fFileID ";
this.fFileIDDataGridViewTextBoxColumn.Name = "fFileIDDataGridViewTextBoxColumn ";