sorted ListView bisa ascending bisa descending. Code berikut pake event
ColumnClick dengan object name is lv.
Private Sub lv_ColumnClick(ByVal ColumnHeader As
MSComctlLib.ColumnHeader)
If lv.Sorted And ((ColumnHeader.index - 1) = lv.SortKey) Then
lv.SortOrder = 1 - lv.SortOrder
Else
lv.SortOrder = lvwAscending
lv.SortKey = ColumnHeader.index - 1
End If
lv.Sorted = True
End Sub
Best regards
~subchan
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of saripudin hidayat
Sent: Thursday, February 14, 2008 11:42 AM
To: indoprog vb; Programmer VB; thebad kalong; Informatika2000 UMJ
Subject: [Programmer-VB] menampilkan dan mengurutkan data di listiview
Dear all,
Saya ingin menampilkan data dari tabel antrian dengan listview, sehingga
ketika kita klik header listview, maka data akan urut (sort) otomotis
secara asc berdasarkan field yang menjadi header listivew.
Saat ini saya menggunakan data grid, tapi agak sulit diurutkan.
Best Regard
Saripudin Hidayat
'Listing di form_load()
Set RsAntrian = New ADODB.Recordset
StrSql = "select * from tbAntrian order by 1 asc"
RsAntrian.Open StrSql, cn, adOpenDynamic, adLockOptimistic
'Set Adodc1.Recordset = RsPasien
Set DataGrid3.DataSource = RsAntrian
T_Syarat.Clear '
T_Syarat.AddItem "Nomor Antrian"
T_Syarat.AddItem "Tanggal Daftar"
T_Syarat.AddItem "Nama Pasien"
T_Syarat.AddItem "Kode Pasien"
T_Syarat.AddItem "Nomor Rekam Medis"
T_Syarat.AddItem "Umur"
T_Syarat.AddItem "Poli"
T_Syarat.AddItem "Nama Dokter"
T_Syarat.AddItem "Kode Dokter"
T_Syarat.AddItem "Spesialisasi"
________________________________
Bergabunglah dengan orang-orang yang berwawasan, di bidang Anda di
Yahoo! Answers
<http://sg.rd.yahoo.com/mail/id/footer/def/*http://id.answers.yahoo.com/
>
This email and any attachments are confidential and may also be privileged. If
you are not the addressee, do not disclose, copy, circulate or in any other way
use or rely on the information contained in this email or any attachments. If
received in error, notify the sender immediately and delete this email and any
attachments from your system. Emails cannot be guaranteed to be secure or
error free as the message and any attachments could be intercepted, corrupted,
lost, delayed, incomplete or amended. Standard Chartered PLC and its
subsidiaries do not accept liability for damage caused by this email or any
attachments and may monitor email traffic.
Standard Chartered PLC is incorporated in England with limited liability under
company number 966425 and has its registered office at 1 Aldermanbury Square,
London, EC2V 7SB.
Standard Chartered Bank ("SCB") is incorporated in England with limited
liability by Royal Charter 1853, under reference ZC18. The Principal Office of
SCB is situated in England at 1 Aldermanbury Square, London EC2V 7SB. In the
United Kingdom, SCB is authorised and regulated by the Financial Services
Authority under FSA register number 114276.
If you are receiving this email from SCB outside the UK, please click
http://www.standardchartered.com/global/email_disclaimer.html to refer to the
information on other jurisdictions.