ThaiPBL.com

PowerBuilder Library Thailand

อีเมล พิมพ์ PDF

column header

การจัดเรียงข้อมูลของดาต้าวินโดวส์ โดยการคลิกที่ column header

สคริปต์นี้เราจะวางใว้ที่ Clicked event ของตัว ดาต้าวินโดวส์ รายละเอียดมีดังนี้

String ls_old_sort,ls_Column
Char lc_sort

    ls_column = Left(dwo.name,Len(String(dwo.name))-2)
    ls_old_sort = dw_1.Describe("Datawindow.Table.sort")
    If ls_column = Left(ls_old_sort,Len(ls_old_sort)-2) then
       lc_sort = right(ls_old_sort,1)
            If lc_sort = 'A' then
                lc_sort = 'D'
            else
                lc_sort = 'A'
            End if
       dw_1.Setsort(ls_column+" "+lc_sort)
    Else
       dw_1.Setsort(ls_column+" A")
    End if
    dw_1.Sort()



บทความนี้มาจาก www.soopawat.com