看我的代码:
//是否上传
((DataGridViewComboBoxColumn)gvSaleOrder.Columns["submitServer"]).DisplayMember = "text";
((DataGridViewComboBoxColumn)gvSaleOrder.Columns["submitServer"]).ValueMember = "value";
DataTable dtSubmit = new DataTable();
dtSubmit.Columns.Add("text");
dtSubmit.Columns.Add("value", typeof(int));
dtSubmit.Rows.Add(new object[] { "已上传", 1 });
dtSubmit.Rows.Add(new object[] { "未上传", 0 });
dtSubmit.Rows.Add(new object[] { "未上传", 2 });
((DataGridViewComboBoxColumn)gvSaleOrder.Columns["submitServer"]).DataSource = dtSubmit;
我是手工添加的DataTable ,当然你可以从数据库中获取!