Página 1 de 1

Need example of how to work with TDBRadioMenu control

Publicado: Sab Oct 04, 2008 12:19 am
por g.s.rogers
My Radio Menu object has three values: "COUNTY", "STATE", and "NEITHER",
which I understand would correspond to an oDBRadioMenu:nIndex value of 1, 2,
or 3.
To try to get the control to display the database value, in the onCreate
event of the control, I have:
do case
case ::oDBRadioMenuRecipient:Value == "COUNTY"
::oDBRadioMenuRecipient:nIndex := 1
case ::oDBRadioMenuRecipient:Value == "STATE"
::oDBRadioMenuRecipient:nIndex := 2
case ::oDBRadioMenuRecipient:Value == "NEITHER"
::oDBRadioMenuRecipient:nIndex := 3
endcase
To try to get the control to return the correct string value, in the
onChange event of the control, I have:
do case
case ::oDBRadioMenuRecipient:nIndex == 1
::oDBRadioMenuRecipient:Value := "COUNTY"
case ::oDBRadioMenuRecipient:nIndex == 2
::oDBRadioMenuRecipient:Value := "STATE"
case ::oDBRadioMenuRecipient:nIndex == 3
::oDBRadioMenuRecipient:Value := "NEITHER"
endcase
This doesn't seem to work properly in that the form doesn't display the
corresponding radio button as selected when I show that record and still
returns the nIndex value to the oDataSet field, rather than the string
value. I guess I need an example of how to use the RadioMenu control
properly.
TIA,
Gary S. Rogers

Need example of how to work with TDBRadioMenu control

Publicado: Dom Oct 05, 2008 7:05 pm
por ignacio
Gary,
The underlying database field must be a numeric field that acepts the
values: 1, 2 or 3.
To change the value to COUNTY you should do:
oDBRadio:Value := 1
OR
oDbRadio:nIndex := 1
If you database field has the complete strings I suggest you use TDbListBox
o TDbComboBox with the property nDataType set to dtBOUND. Consult the docs.
Regards,
--
Ignacio Ortiz de Zúñiga
[Soporte Xailer]
[Xailer support]
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:48e69a85$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> My Radio Menu object has three values: "COUNTY", "STATE", and "NEITHER",
> which I understand would correspond to an oDBRadioMenu:nIndex value of 1,
> 2, or 3.
>
> To try to get the control to display the database value, in the onCreate
> event of the control, I have:
>
> do case
> case ::oDBRadioMenuRecipient:Value == "COUNTY"
> ::oDBRadioMenuRecipient:nIndex := 1
> case ::oDBRadioMenuRecipient:Value == "STATE"
> ::oDBRadioMenuRecipient:nIndex := 2
> case ::oDBRadioMenuRecipient:Value == "NEITHER"
> ::oDBRadioMenuRecipient:nIndex := 3
> endcase
>
> To try to get the control to return the correct string value, in the
> onChange event of the control, I have:
>
> do case
> case ::oDBRadioMenuRecipient:nIndex == 1
> ::oDBRadioMenuRecipient:Value := "COUNTY"
> case ::oDBRadioMenuRecipient:nIndex == 2
> ::oDBRadioMenuRecipient:Value := "STATE"
> case ::oDBRadioMenuRecipient:nIndex == 3
> ::oDBRadioMenuRecipient:Value := "NEITHER"
> endcase
>
> This doesn't seem to work properly in that the form doesn't display the
> corresponding radio button as selected when I show that record and still
> returns the nIndex value to the oDataSet field, rather than the string
> value. I guess I need an example of how to use the RadioMenu control
> properly.
>
> TIA,
> Gary S. Rogers

Need example of how to work with TDBRadioMenu control

Publicado: Dom Oct 05, 2008 7:05 pm
por NoName
Gary,
The underlying database field must be a numeric field that acepts the
values: 1, 2 or 3.
To change the value to COUNTY you should do:
oDBRadio:Value := 1
OR
oDbRadio:nIndex := 1
If you database field has the complete strings I suggest you use TDbListBox
o TDbComboBox with the property nDataType set to dtBOUND. Consult the docs.
Regards,
--
Ignacio Ortiz de Zúñiga
[Soporte Xailer]
[Xailer support]
"Gary S. Rogers" <g.s.rogers@att.net> escribió en el mensaje
news:48e69a85$[email=1@ozsrv2.ozlan.local...]1@ozsrv2.ozlan.local...[/email]
> My Radio Menu object has three values: "COUNTY", "STATE", and "NEITHER",
> which I understand would correspond to an oDBRadioMenu:nIndex value of 1,
> 2, or 3.
>
> To try to get the control to display the database value, in the onCreate
> event of the control, I have:
>
> do case
> case ::oDBRadioMenuRecipient:Value == "COUNTY"
> ::oDBRadioMenuRecipient:nIndex := 1
> case ::oDBRadioMenuRecipient:Value == "STATE"
> ::oDBRadioMenuRecipient:nIndex := 2
> case ::oDBRadioMenuRecipient:Value == "NEITHER"
> ::oDBRadioMenuRecipient:nIndex := 3
> endcase
>
> To try to get the control to return the correct string value, in the
> onChange event of the control, I have:
>
> do case
> case ::oDBRadioMenuRecipient:nIndex == 1
> ::oDBRadioMenuRecipient:Value := "COUNTY"
> case ::oDBRadioMenuRecipient:nIndex == 2
> ::oDBRadioMenuRecipient:Value := "STATE"
> case ::oDBRadioMenuRecipient:nIndex == 3
> ::oDBRadioMenuRecipient:Value := "NEITHER"
> endcase
>
> This doesn't seem to work properly in that the form doesn't display the
> corresponding radio button as selected when I show that record and still
> returns the nIndex value to the oDataSet field, rather than the string
> value. I guess I need an example of how to use the RadioMenu control
> properly.
>
> TIA,
> Gary S. Rogers