cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button SDK 2007

Former Member
0 Kudos

Hi,

I have 6 radio buttons (2x3), and all buttons are off when I load the form.

I like to set 1 button on when I load the form.

I used following code and 2 radio buttons goes on?

( ( SAPbouiCOM.OptionBtn ) ( oForm.Items.Item("optDay4").Specific ) ).Selected = true;

// Per Day

oItem = oForm.Items.Add("optDay4", SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON);

oItem.Left = 850;

oItem.Top = 160;

oItem.FromPane = 4;

oItem.ToPane = 4;

oOptionBtn = ( ( SAPbouiCOM.OptionBtn ) ( oItem.Specific ) );

oOptionBtn.Caption = "Per Day";

oOptionBtn.DataBind.SetBound(true, "", "OpBtnDS4");

I like to set the button on here.

1) Why are my two (2) radio button column connected with each other (they are not grouped with each other "oOptionBtn.GroupWith("optNo4");" and oOptionBtn.GroupWith("optDay4");

2) How do I set the radio button on when I build the radio button to the form?

Thank you,

Rune

Message was edited by:

Rune Brattas

Message was edited by:

Rune Brattas

Accepted Solutions (1)

Accepted Solutions (1)

former_member583013
Active Contributor
0 Kudos

Please mark this question as Answered. Thanks

Answers (1)

Answers (1)

Former Member
0 Kudos

I found the solution. Create a user datasource for both rows of option buttons:

// Option button. Create a user Datasource for the option buttons

UDSTab4 = oForm.DataSources.UserDataSources.Add("OpBtnDS4A", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);

UDSTab4 = oForm.DataSources.UserDataSources.Add("OpBtnDS4B", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 1);

Thank you

Rune