on 11-20-2009 8:01 PM
Hi,
I have a check box whose checked property I'm trying to set to true, but it just won't set. Even if I litterally say oCheck.Checked = True, it remains False. I'm using a user data source of short text with one character just as I do in a previous add-on. The previous add-on works but second one doesn't. In order to get the second add-on to work, I had to use the ValOn and ValOff properties. Would there be any reason for this? I'd like to understand what is going on.
Thanks,
Mike
Hello,
Use the Val ValOFf Property
Dim oCheck As SAPbouiCOM.CheckBox = oForm.Items.Add("CHK", BoFormItemTypes.it_CHECK_BOX).Specific()
oCheck.ValOn = "Y"
oCheck.ValOff = "N"
oCheck.Caption = "TEST"
oForm.DataSources.UserDataSources.Add("CHKDS", BoDataType.dt_SHORT_TEXT, 1)
oCheck.DataBind.SetBound(True, "", "CHKDS")
oForm.DataSources.UserDataSources.Item("CHKDS").Value = "Y"
After you have binded to the datasource, you can check/unCheck by UserDataSource Value to set Y/N, or You can check/uncheck true code.
Regards,
János
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Based on the Forum rule please post your next question in a new Thread, and Close the Thread / give points when anwers...
By the way:
SDK HELP : C:Program FilesSAPSAP Business One SDKSamplesCOM UIVB.NET07.ComplexForm2003 Complexform example
oForm.DataSources.UserDataSources.Add("OpBtnDS", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1)
For i = 1 To 3
oItem = oForm.Items.Add("OpBtn" & i, SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)
oItem.Left = 20
oItem.Width = 100
oItem.Top = 30 + (i - 1) * 19
oItem.Height = 19
oItem.FromPane = 1
oItem.ToPane = 1
oOptionBtn = oItem.Specific
oOptionBtn.Caption = "Option Button" & i
If i > 1 Then
oOptionBtn.GroupWith(("OpBtn" & i - 1))
End If
oOptionBtn.DataBind.SetBound(True, "", "OpBtnDS")
Next i
oForm.DataSources.UserDataSources.Item("OpBtnDS").Value = 1 '1st is selected
oForm.DataSources.UserDataSources.Item("OpBtnDS").Value = 2 '2nd is selected
'...etc
There 3 Option Buttons are groupped together, and DataSource Value gives 1,2,3 if 1st, 2nd, 3rd selected.
Regards,
János
Hi Mike,
could you please post the code over here, so that we can have a look and try to identify the where the code is failing.
regards
shiva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mike,
For a Check Box to work, the following Points are mandatory,
The Check box be databinded to a datasource of character length 1, as and soon as the Form is loaded.
The Check box should be assigned the ValOn Property.
Regards,
Siju Dasan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
7 | |
6 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.