gridcontrol中使用repositoryItemSearchLookUpEdit
gridcontrol中使用repositoryItemSearchLookUpEdit,选取值后,鼠标移出当前单元格,值就消失了,还有编辑其他单元格也是一样另外repositoryItemSearchLookUpEdit能不能在设计器中编辑列,现在是手工代码添加列
你没绑定数据源 先触发个CellValueChang事件,然后再反填数据 //选择单据编号带出数据
private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
if (e.Column.FieldName == "d_FBillNo")
{
string id = e.Value.ToString();
DataRow[] dr = edit_ds.Tables.Select(string.Format("单据编号 = '{0}'", id));
if (dr != null && dr.Length > 0)
{
DataRow row = dr;
string FBatchNo = row["批号"].ToString();
string FHeadSelfB0147 = row["订单单号"].ToString();
string FName = row["产品名称"].ToString();
string FModel = row["规格型号"].ToString();
string Unit = row["计量单位"].ToString();
string FStatus = row["审标"].ToString();
string Organization = row["购货单位"].ToString();
DateTime FDate = (DateTime)(row["单据日期"]);
gridView1.SetRowCellValue(e.RowHandle, "d_FBatchNo", FBatchNo);
gridView1.SetRowCellValue(e.RowHandle, "d_FHeadSelfB0147", FHeadSelfB0147);
gridView1.SetRowCellValue(e.RowHandle, "d_FName", FName);
gridView1.SetRowCellValue(e.RowHandle, "d_FModel", FModel);
gridView1.SetRowCellValue(e.RowHandle, "d_Unit", Unit);
gridView1.SetRowCellValue(e.RowHandle, "d_FStatus", FStatus);
gridView1.SetRowCellValue(e.RowHandle, "d_Organization", Organization);
gridView1.SetRowCellValue(e.RowHandle, "d_FDate", FDate);
// repositoryItemSearchLookUpEdit1View.se
}
} 我还做了个功能可以多选的,但是只做了一部分,有问题,详细见http://www.dxper.net/thread-4558-1-1.html,帮忙看一下
sunrayljs 发表于 2015-6-30 10:12
你没绑定数据源
绑定了,应为要录入数据,所以数据源是空的 sunrayljs 发表于 2015-6-30 10:14
先触发个CellValueChang事件,然后再反填数据
CellValueChang里面E.Value=null
页:
[1]