MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

Sort Datawindow on clicking the Datawindow Header in PowerBuilder

Published on 16 September 16
1444
0
3
// Create a Datawindow with header
// When we click on the datawindow header, the below code will sort the datawindow based on the header selection. If the datawindow is already sorted(suppose with col1 ascending) , the below code checks for it and sorts with col1 desc crieteria.
// Write the below code in the Datawindow Clicked event
string ls_columnheader,ls_columnName,ls_sortcriteria
ls_columnheader=dwo.name

ls_sortcriteria = this.Object.DataWindow.Table.Sort

if right(ls_columnheader,2)='_t' then // Column header contains _t
ls_columnName=left(ls_columnheader,(len(ls_columnheader)-2))
// while sorting we should not have the _t in the name
if right(ls_sortcriteria,2)=" D" then
this.setsort(ls_columnName+" A")
else
this.setsort(ls_columnName+" D")
end if
setpointer(hourglass!)
this.sort( )
end if
Sort Datawindow on clicking the Datawindow Header in PowerBuilder - Image 1
Sort Datawindow on clicking the Datawindow Header in PowerBuilder - Image 2
// Create a Datawindow with header// When we click on the datawindow header, the below code will sort the datawindow based on the header selection. If the datawindow is already sorted(suppose with col1 ascending) , the below code checks for it and sorts with col1 desc crieteria.

// Write the below code in the Datawindow Clicked event

string ls_columnheader,ls_columnName,ls_sortcriteria

ls_columnheader=dwo.name

ls_sortcriteria = this.Object.DataWindow.Table.Sort

if right(ls_columnheader,2)='_t' then // Column header contains _t

ls_columnName=left(ls_columnheader,(len(ls_columnheader)-2))

// while sorting we should not have the _t in the name

if right(ls_sortcriteria,2)=" D" then

this.setsort(ls_columnName+" A")

else

this.setsort(ls_columnName+" D")

end if

setpointer(hourglass!)

this.sort( )

end if

Sort Datawindow on clicking the Datawindow Header in PowerBuilder - Image 1

Sort Datawindow on clicking the Datawindow Header in PowerBuilder - Image 2

This blog is listed under Development & Implementations and Data & Information Management Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top