Dev表格RepositoryItemLookUpEdit组件改变值时设置其它列的值-原创
Dev表格RepositoryItemLookUpEdit组件改变值时设置其它列的值-原创
注意:绑定RepositoryItemLookUpEdit数据源的DisplayMember,ValueMember属性,
要绑定ID编号字段,界面效果如下图:
C# Code:
private void gvDetail_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
if (this.IsAddOrEditMode)
{
if (e.Column == colD_WorkTypeID)//工种
{
object o = repWorkType.GetDataSourceValue("TypeName", repWorkType.GetDataSourceRowIndex("TypeID", e.Value));
gvDetail.SetFocusedRowCellValue(tb_PlanUnitVDtl.WorkTypeName, o);
}
else if (e.Column == colD_GroupID)//班组
{
object o = repGroup.GetDataSourceValue("GroupName", repGroup.GetDataSourceRowIndex("GroupID", e.Value));
gvDetail.SetFocusedRowCellValue(tb_PlanUnitVDtl.GroupName, o);
}
}
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
private void gvDetail_CellValueChanging(object sender, CellValueChangedEventArgs e)
{
if (this.IsAddOrEditMode)
{
if (e.Column == colD_WorkTypeID)//工种
{
object o = repWorkType.GetDataSourceValue("TypeName", repWorkType.GetDataSourceRowIndex("TypeID", e.Value));
gvDetail.SetFocusedRowCellValue(tb_PlanUnitVDtl.WorkTypeName, o);
}
else if (e.Column == colD_GroupID)//班组
{
object o = repGroup.GetDataSourceValue("GroupName", repGroup.GetDataSourceRowIndex("GroupID", e.Value));
gvDetail.SetFocusedRowCellValue(tb_PlanUnitVDtl.GroupName, o);
}
}
}
//来源:C/S框架网(www.csframework.com) QQ:23404761
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网