Dev表格RepositoryItemLookUpEdit组件改变值时设置其它列的值-原创
作者:C/S框架网  发布日期:2018-11-14 20:44:58
  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





上一篇 下一篇