1. Michał Misijuk
  2. PowerBuilder
  3. Tuesday, 13 August 2019 06:21 AM UTC

I have a DW, and right now I am able to edit every row and column.
I would like to block all rows when DW opens, and be able to edit row only, if I choose it first and press f.e. button EDIT.
Is there a property which i have to set on open event?

Accepted Answer
René Ullrich Accepted Answer Pending Moderation
  1. Tuesday, 13 August 2019 07:08 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Michał,

you may deal with the protect property for columns.

You may control the protection of a single row by a separate column. Add a column (e.g. "protected") and load it with 1 on retrieve. Set the expression of protect property for all columns to "protected" (simply the column name because it contains 0 or 1).

On buttonclick simply change the value of the "protected" column to 0 to make the columns editable.

HTH,

René

Comment
  1. Michał Misijuk
  2. Tuesday, 13 August 2019 07:55 AM UTC
Hi René

I added a column (Edit), by adding in select

1 as "EDIT"



Then in columnproperty Protect i set an expression

EDIT = 1



and still i can edit column value. Any idea?
  1. Helpful
  1. René Ullrich
  2. Tuesday, 13 August 2019 08:00 AM UTC
The expression for protect property should result in 0 (= not protected) or 1 (=protected). So your expression should be "if(edit = 1, 0, 1)".
  1. Helpful
  1. Michał Misijuk
  2. Tuesday, 13 August 2019 08:48 AM UTC
Thank You very much! Works as charm!
  1. Helpful
There are no comments made yet.
Olan Knight Accepted Answer Pending Moderation
  1. Tuesday, 13 August 2019 16:25 PM UTC
  2. PowerBuilder
  3. # 1

This is simple. The initial state is
   dw_edit.Enabled = FALSE

When the user clickes the EDIT button, then:
   dw_exit.Enabled = TRUE.


Olan

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.