Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get the selected row in a DW with groups

Status
Not open for further replies.

TonCoronel

Programmer
Dec 1, 2003
37
NL
I have a Datawindow that has a group in it. I only display the headers of the groups. If a user doubleclicked on a row in the datawindow it should openup a new window with some details. But if I use the getrow method it always returns 1.
 
GetRow() is always returning 1 because clicking or doubleclicking a heading is not going to cause the current row to change. I don't believe there is any way to do this without displaying detail rows.
 
You could try to share the data from the grouped datawindow with the detail datawindow and then filter the detail based on some information from the group header.
 
See: GetBandAtPointer method (DataWindows)

"Reports the band in which the pointer is currently located, as well as the row number associated with the band. The bands are the headers, trailers, and detail areas of the DataWindow and correspond to the horizontal areas of the DataWindow painter."


In your datawindow doubleclick event use this:

Code:
String band
band = dw_rpt.GetBandAtPointer()

Some possible return values are:

Return value Meaning
detail[tab]8 In row 8 of the detail band of dw_rpt
header[tab]10 In the header of dw_rpt; row 10 is the first visible row
header.2[tab]1 In the header of group level 2 for row 1
trailer.1[tab]5 In the trailer of group level 1 for row 5
footer[tab]111 In the footer of dw_rpt; the last visible row is 111
summary[tab]23 In the summary of dw_rpt; the last row is 23
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top