Protect DataWindow object property
Description
The protection setting of a column. The Protect property overrides
tab order settings. When a column is protected, the user cannot
edit it even if the column’s tab order is greater than
0.
Controls
A column
Syntax
PowerBuilder dot notation:
1 |
<span>dw_control</span>.Object.<span>columnname</span>.Protect |
Describe and Modify argument:
1 |
"<span>columnname</span>.Protect { = '<span> integer </span>' }" |
Parameter |
Description |
---|---|
columnname |
The name of the column for which you |
integer |
(exp) A boolean integer specifying whether Values are:
Integer can be a quoted DataWindow expression. |
Usage
A user cannot change a column value if any one of these conditions
is true:
-
TabSequence is 0
-
Edit.DisplayOnly is Yes when the column has the
Edit edit style -
Protect is 1
Only the Protect property allows you to specify a conditional
expression that protects some values in the column but not others.
In the painter
Select the control and set the value in the Properties view, General
tab (using a conditional expression).
Examples
1 |
string setting |
1 |
setting = dw1.Object.emp_stat.Protect |
1 |
dw1.Object.emp_stat.Protect=1 |
1 |
setting = dw1.Describe("emp_stat.Protect") |
1 |
dw1.Modify("emp_stat.Protect=1") |
1 |
dw1.Modify("emp_stat.Protect='1~tIf(IsRowNew(),0,1)'") |