c#datagridview的显示问题
我从数据库里查询一张表的数据,付给datagridview 其中 有 三列是 combobox类型的,我给datagridview的datasource属性赋值时 出现了datagridviewcomboboxcell值无效 ,但是 我 已经给 这三列combobox的datasource属性赋值了啊 代码如下
DataTable dt = new DataTable();
dt.Columns.Add("OriginalCode");
dt.Columns.Add("OriginalName");
DataRow dr1 = dt.NewRow();
dr1["OriginalCode"] = "True";//赋值为1或0也不好用
dr1["OriginalName"] = "原件";
DataRow dr2 = dt.NewRow();
dr2["OriginalCode"] = "False";
dr2["OriginalName"] = "复印件";
dt.Rows.Add(dr1);
dt.Rows.Add(dr2);
dgvfcmbIsOriginal.DataSource = dt;
dgvfcmbIsOriginal.DisplayMember = "OriginalName";
dgvfcmbIsOriginal.ValueMember = "OriginalCode";
DataTable dt = new DataTable();
dt = CommonMethodHelper.ToDataTable(Cost_FeeInfoManager.GetCost_FeeInfoByBusinessNum(cfi));
//为付款信息赋值
dgvfcmbCurrency_Name.DataSource = dt;
dgvfcmbCurrency_Name.DisplayMember = "Currency_Name";
dgvfcmbCurrency_Name.ValueMember = "Currency_Id";
//dgvfcmbCurrency_Name的datapropertyname的值是Currency_Name
ghdgvFukuan.DataSource = dt;