cancel
Showing results for 
Search instead for 
Did you mean: 

getrow() not return proper row number after using the modify() function

Former Member
0 Kudos

Hi Everyone,

I am using PowerBuilder 11.1 build 8123.


I am protecting the column and changed the background mode of data window column through modify() function in user defined local function (where datawindow is argument type and pass by is reference). Data window have more than one row and one selected row. Before modify the column's, getrow() function return right selected row, but after modify it return any other row number. code is written in fwc_retrieve event.

I also use scrolltorow() and setrow() functions after modify(), but these have not worked.

In my application PFC is used. I don't able to find out the reason.

Please help.

Thanks,

Vikrant

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

It is unclear why you need to use the Modify() function to redefine the datawindow after your window has initialised. Try adding a condition to the protect and background properties of the column in the Datawindow painter at design time.

If you can only determine the condition at run-time, then use the Modify() function in the datawindow control constructor event (so is only run once), and supply a condition...

eg.

// Minor DOB protected on minor flag

object.minor_dob.background.mode="0~tif (  minor  = 'Y', 0, 1 )"

object.minor_dob.protect="0~tif (  minor  = 'Y', 0, 1 )"

Former Member
0 Kudos

Hi Vikrant;

  This is not a bug as a Modify ( ) method for a column affects all rows that the column is displayed under. Your probably getting the last row that the modified column was last operated on.

  I would use the GetRow ( ) and GetSelectedRow ( ) to trap the current rows for the DWO you are about to modify and then when the update is completed,  use the SetRow() and SelectRow () methods to re-establish the same row state on the passed DWO.

HTH

Regards ... Chris