WinBatch® Technical Support Forum

Archived Boards => WinBatch Dynamic Dialogs => Topic started by: mcvpjd3 on August 28, 2013, 01:57:30 AM

Title: Reportview column header
Post by: mcvpjd3 on August 28, 2013, 01:57:30 AM
I'm using a report view with headers and I've used some code I found in the database for sorting the columns when the header is clicked. It's working fine except the part that re-names the header. It updates the 1st columns to be ASCENDING or DESCENDING as appropriate. However, if this isnt appropriate if the user clicks the second or third column. How can I tell which header the user clicks on so I can update the appropriate column?

Thanks
Title: Re: Reportview column header
Post by: kdmoyers on August 28, 2013, 07:09:57 AM
if you capture the MSG_RVHEADER event, the column header name that was clicked on is in the fifth callback parameter.  Or as the help file puts it:

QuoteColumn Click: User has used the mouse to click a column header of a REPORTVIEW control. The one based column number of the clicked column is passed to the callback UDF/UDS in the callback's fifth parameter. The event is fired before the indicated column is sorted so the sort direction can be controlled by setting or changing the sort direction style of the control during the callback. Sorting is effectively cancelled by removing both sorting related styles from the control.

-Kirby
Title: Re: Reportview column header
Post by: Deana on August 28, 2013, 09:34:37 AM
In your MSG_RVHEADER (22) event, you can look at the fifth parameter of your dialog callback function (MyDialog_ChangeInfo) to see what number is the column that was selected.

Code (winbatch) Select

     case MSG_RVHEADER
        selectedCol = MyDialog_ChangeInfo
        Pause('Selected Column Number',selectedCol)                           
        return(RET_DO_NOT_EXIT)