https://blog.csdn.net/keenweiwei/article/details/7545410
1,gridview的某一列的 columnEdit 设为 repositoryItemLookUpEdit
2, 在 form_load中 写如下代码
先给 gridcontrol赋 datasource:A (A中的某一列对应的值为0 或1,但显示出来却要求是 停用 或 启用)
,然后
DataTable dtTmp=new DataTable(); dtTmp.Columns.Add("c1"); dtTmp.Columns.Add("c2"); DataRow drTmp = dtTmp.NewRow(); drTmp[0] = 0; drTmp[1] = "停用"; dtTmp.Rows.Add(drTmp); drTmp = dtTmp.NewRow(); drTmp[0] = 1; drTmp[1] = "启用"; dtTmp.Rows.Add(drTmp); repositoryItemLookUpEdit1.DataSource = dtTmp; repositoryItemLookUpEdit1.DisplayMember = "c2"; repositoryItemLookUpEdit1.ValueMember = "c1";