2020-09-03 14:28发布
加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)
嗨,
如何在表单中选中我的复选框?
谢谢
Rune
这不起作用:
(((SAPbouiCOM.CheckBox)(oForm_M.Items.Item(" cbxMarketi")。Specific))。ValOn =" Y";
使用数据绑定没有找到任何解决方案,请参见下面的代码。
C#SAP CheckBox数据绑定
//SAPbouiCOM.CheckBox oCheckBox =(SAPbouiCOM.CheckBox)(oForm_M.Items.Add(" cbxMarketi",SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX).Specific); //我的检查框为XML格式 SAPbouiCOM.CheckBox oCheckBox =(SAPbouiCOM.CheckBox)(oForm_M.Items.Item(" cbxMarketi")。Specific); oCheckBox.ValOff =" N"; oCheckBox.ValOn =" Y"; oCheckBox.Caption = vm_Text_string; oForm_M.DataSources.UserDataSources.Add(" cbxDS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,1); oCheckBox.DataBind.SetBound(true,""," cbxDS"); oForm_M.DataSources.UserDataSources.Item(" cbxDS")。Value =" N"; vm_MarketingPermission_string = oBusinessPartners.UserFields.Fields.Item(" U_MarketingPermissio")。Value.ToString(); 如果(vm_MarketingPermission_string ==" Y") { oForm_M.DataSources.UserDataSources.Item(" cbxDS")。Value =" Y"; } 其他 { oForm_M.DataSources.UserDataSources.Item(" cbxDS")。Value =" N"; }
我找不到
... DataSources.UserDataSources ....
在我的form1中?!
在Form1.b1f.cs中找到了它:
初始化于:
private void OnCustomInitialize() {....
this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk1DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,1); this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk2DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT, ); this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk3DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,1);
....
chkContReg.DataBind.SetBound(true,""," chk1DS"); chkContReg.Caption =" YourCaption"; chkContReg.ValOn =" Y"; chkContReg.ValOff =" N "; this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk1DS")。Value =" N"; this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk2DS")。Value =" N"; this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk3DS")。Value =" N";
....}
最多设置5个标签!
嗨,
使用数据绑定没有找到任何解决方案,请参见下面的代码。
Rune
C#SAP CheckBox数据绑定
我找不到
在我的form1中?!
在Form1.b1f.cs中找到了它:
初始化于:
private void OnCustomInitialize()
{....
this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk1DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,1);
this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk2DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT, );
this.UIAPIRawForm.DataSources.UserDataSources.Add(" chk3DS",SAPbouiCOM.BoDataType.dt_SHORT_TEXT,1);
....
chkContReg.DataBind.SetBound(true,""," chk1DS");
chkContReg.Caption =" YourCaption";
chkContReg.ValOn =" Y";
chkContReg.ValOff =" N ";
this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk1DS")。Value =" N";
this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk2DS")。Value =" N";
this.UIAPIRawForm.DataSources.UserDataSources.Item(" chk3DS")。Value =" N";
....
....}
一周热门 更多>