I have 2 line of codes in sorting a listview.
Try to add this codes to your listview_columnclick
listview1.sortkey = columnheader.index - 1
lstview1.sorted = true
Showing posts with label ListView. Show all posts
Showing posts with label ListView. Show all posts
Monday, October 20, 2008
Sunday, August 31, 2008
Populate ListView from SQL Server
Hello to all.
Today my sample is all above listview. Populate listview of data from database.
If you have ur connectionstring and recordset. Then set 1 listview and 1 commandbutton.
In your command button insert this code:
Dim Item as ListItem 'variable for your subitems
ListView1.ListItems.Clear 'Clear your Listview before loading a new data
While Not rs.eof
Set Item = ListView1.ListItems.Add(,,rs!One)
Item.Subitems(1) = rs!Two
rs.movenext
Wend
Hope this one will help you
Today my sample is all above listview. Populate listview of data from database.
If you have ur connectionstring and recordset. Then set 1 listview and 1 commandbutton.
In your command button insert this code:
Dim Item as ListItem 'variable for your subitems
ListView1.ListItems.Clear 'Clear your Listview before loading a new data
While Not rs.eof
Set Item = ListView1.ListItems.Add(,,rs!One)
Item.Subitems(1) = rs!Two
rs.movenext
Wend
Hope this one will help you
Subscribe to:
Posts (Atom)