Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Radio Buttons on Datawindows?

Status
Not open for further replies.

kaul125

Programmer
Jan 29, 2002
87
US
I have 3 fields in my database that are defined as integer datatypes. If I pass a 1 to the field that means the field is active and 0 means the field is inactive.

I originally set these fields up as checkboxes. However, I want the 3 fields as radios buttons so the user can only select one and not all. However the edit style for radiobuttons requires at least 2 display values for the column. Example of what I want to do is:

3 Fields:
Field 1
Field 2
Field 3

If the user selects 'field 1' that means field 1 is active and the other 2 are inactive. I just want to show 1 display value for each field. I would like to know how I can do this directly on the datawindow?

Keith
 
Don't think you can combine 3 data columns on 1 edit column. Unless you have a problem with the ItemChanged event, I'd control the data that goes in the 3 columns with code in the event. Place a computed column on the DW, change the edit to RadioButton with three options, and script the ItemChanged event to trap the RB chosen and fill the 3 data columns. HTH
 
As I placed the computed field on the dw, I did not see the option to make this a radiobutton? What dialog do you see this option on?

In the meantime, I put the radiobuttons directly on the window, from the window painter. As the user checks these objects, I just check the enabled property and do a setitem on the dw field prior to saving. This works fine.

Keith
 
Can't do it with a computed column, only with a column in the data source.
 
Hi,

Computed-Field does not have Edit properties. Include a Computed-Column in the SQL (data-source) such as:

'' AS CC_Option

from the Compute tabpage or by Converting it to Syntax and set its Edit property to Radio Button. In the UpdateStart! event or somewhere, map the chosen value to the corresponding columns.

Regards,

--
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top