1. Simone Olianti
  2. PowerBuilder
  3. Friday, 11 May 2018 15:42 PM UTC

hi there,

i have a datawindow with a group. i placed a button in the header of the group but when i click on it, in the event clicked i always get the row number = 0

is there a way to get the first row of each group break?

tia

Who is viewing this page
Accepted Answer
Simone Olianti Accepted Answer Pending Moderation
  1. Tuesday, 15 May 2018 07:06 AM UTC
  2. PowerBuilder
  3. # Permalink

thank you everyone!

i figured out how to get the first row of a dw group using the GetbandAtPointer() method in the clicked event of the button

String ls_ret
long rownum
ls_ret = dw_1.GetbandAtPointer()
ls_ret= mid(ls_ret, (pos(ls_ret, '~t', 1) + 1), 3)
rownum = long(ls_ret)

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Monday, 14 May 2018 13:35 PM UTC
  2. PowerBuilder
  3. # 1

Hi Simone;

   Hae you tried using the FindGroupChange method for this?

Regards ... Chris

Comment
There are no comments made yet.
Lars Mosegaard Accepted Answer Pending Moderation
  1. Monday, 14 May 2018 06:29 AM UTC
  2. PowerBuilder
  3. # 2

I would use the buttonclicked event instead of clicked event.  

The row argument will be the first row for the group

Comment
There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Sunday, 13 May 2018 20:39 PM UTC
  2. PowerBuilder
  3. # 3

Hi Simone,

It is possible using "DataWindow expressions" to obtain row information related to a specific group or page. One option for first row within a group is:

  1. Create a computed column in the group header, (ex: name = first_row)
  2. Define its expression = GetRow( )
  3. Make it visible so you can verify visually as you write your code
    ​Later hide it if you don't want users to see the value on screen

For further info, see PB Help > DataWindow Reference > DataWindow Expression Functions > Alphabetical list of DataWindow expression functions > GetRow

DataWindow expression functions related to groups: CurrentRow, First, and Last

HTH /Michael

Comment
There are no comments made yet.
radha rani Accepted Answer Pending Moderation
  1. Friday, 11 May 2018 16:09 PM UTC
  2. PowerBuilder
  3. # 4

Hi simone,

Please share the screen shot of your code,then only can fugure out what wrong in tht.

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.