I have a datawindow with a column being displayed as a number of
readiobuttons (the column edit style type = RadioButtons).
Under certain circumstances, I need to disable some radiobuttons so they
appear 'ghosted' and the user cannot select it.
Could someone tell me if this is possible and if so, please provide the
syntax.
Thanks in advance.
On 21 Sep 2004 01:43:17 -0700, "Ian Brouwer" <i_bNOro...@tsd.nl>
wrote:
Bruce Armstrong [TeamSybase]
http://www.teamsybase.com
TeamSybase blogs:
http://www.teamsybase.net/blogs
Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups
Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com
Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org
---------------------------------------------------------------------
DISCLAIMER:
This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.
Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.
string ls_modstring
ls_Modstring = + &
as_ColName + ".radiobuttons.3D=NO " + &
as_ColName + ".radiobuttons.scale=YES "
dw_1.Modify( ls_modstring )
To enable that same column, flip the NO's and YES's.
--
Paul Horan[TeamSybase]
"Ian Brouwer" <i_bNOro...@tsd.nl> wrote in message news:414feb74$1@forums-2-dub...
I basically use Paul's approach but execute this through an SQL computed
column (acting as a switch) and placing expressions on the RB's that
interrogate the CC's state and set the various properties accordingly. This
saves allot of external DW Control code like Paul has shown you. However,
either technique achieves the same end result.
Food for thought.
Regards ... Chris
"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:415030bf$1@forums-2-dub...
We created a function in the ancestor datawindow - uo_EnableCol( string as_colName, boolean ab_Enable)
The code I showed is in the function, and it handles all the other edit styles as well. So our application code only
has to call:
dw_1.uo_EnableCol( 'myColumn', TRUE ) - to enable, and vice versa to disable.
That saves having to code extra controls into the datawindow itself. More food for thought... ;)
--
Paul Horan[TeamSybase]
Thanks for the tip, except the example disabled the 'column' instead of one
of the radio buttons for 1 of the values for that column.
Example:
The column name is 'Status' which can contain the values 0, 1 or 2.
So in normal circumstances 3 radio buttons for this column will be enabled
and displayed.
In certain circumstances I want all radio buttons to be visible, but only
enable the radio buttons for the values 1 and 2, and disable the radio
button for the value 0.
Can anyone help we this one ?
Ian
"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> schreef in bericht
news:415030bf$1@forums-2-dub...
I would add two computed columns to the select statement:
...
0 as three_choice,
0 as two_choice,
FROM
...
Set each of these up as radio buttons - the first with all three choices, and the second with only two (I don't think
there's a way to display the third as disabled). Don't even put the original column on the dw surface. Then toggle the
visible attribute for these two to display the one you want and hide the other. Use the ItemChanged event to do
SetItem( row, "original_rb_column", data ) when either of the two "fake" columns are changed.
--
Paul Horan[TeamSybase]
"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:41504423@forums-2-dub...
"Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom> wrote in message
news:41515684@forums-1-dub...
Radio button edit style for the column is a poor choice - it
is just a code table presented in a funky way/ The code
table is common for the column in ALL the rows.
Use a dddw edit style either with:
1) Easier - visual indicator that n of the choices are not
suitable combined with scripting in the itemchanged that
disallows their choice
2) Harder - creative conditional filtering of the dddw