repositoryItemLookUpEdit 嵌套在 gridcontrol 中 作为列下拉 效果就是多列的 combox
代码如下
var y = userinfo.Select.ToList(
a => new
{
userid = a.id,
codename = a.name + "(" + a.code + ")",
isok=a.isok
}
);
repositoryItemLookUpEdit1.NullText = string.Empty;
repositoryItemLookUpEdit1.DisplayMember = "codename"; //这里要注意大小写,跟数据库保持一致
repositoryItemLookUpEdit1.ValueMember = "userid";
repositoryItemLookUpEdit1.DataSource = y;
最新的代码如下:
//库存状态列渲染
string sqlString = "select distinct dfl.data_value a, dfl.data_value || ':' || dflt.data_tag b,1 c " +
"from data_field_list dfl, data_field_list_t dflt " +
"where data_field_bo in (select handle from data_field df where data_field = 'INVENTORY_STATUS') " +
" and dfl.handle = dflt.data_field_list_bo " +
"order by 1";
RepositoryItemLookUpEdit repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit()
{
NullText = string.Empty,
DisplayMember = "B", //这里要注意大小写,跟数据库保持一致
ValueMember = "A", //这里要注意大小写,跟数据库保持一致
DataSource = mes.Ado.ExecuteDataTable(sqlString)
};
gridView1.GridControl.RepositoryItems.Add(repositoryItemLookUpEdit1);
gridView1.Columns["INVENTORY_STATUS"].ColumnEdit = repositoryItemLookUpEdit1;