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!

Datawindow: Adding a button object to header 1

Status
Not open for further replies.

girls3dog1

Programmer
Nov 22, 2002
30
US
I have added a command button (one for each column) to the heading of a datawindow object and selected the Action property to be "Userdefined". Is it true that the script for the button would reside in the "buttonclicked" event of the datawindow? If so, can I then use the Getcolumnname method within the "buttonclicked" event to determine which column header button was clicked? I tried this but it did not pick up the column name and I don't know why.
 
Hi,

For using dw-Buttons, you need to give them some names in the layout painter such as cb_SortAsc, cb_SortDesc... Then, in the ButtonClicked! event of the dw (on the surface of the window), you can write code similar to:

//////////////////////////////////////
IF dwo.Name = "cb_sortasc" THEN
<Do stuff>
ELSEIF dwo.Name = &quot;cb_sortdesc&quot; THEN
<Do stuff>
END IF ;
//////////////////////////////////////

As you can see, the dw-Buttons can be scripted in similar way as a dw-column (in a different event - ButtonClicked! - and with a slight difference in the event arguments).

Regards,

--
PowerObject!
-----------------------------------------
PowerBuilder / PFC Developers' Group
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top