I have a listview and some data and i would like to use some filters
For example: Show all records with id>14
Is there any way to do that?
Thanks in advance.
Printable View
I have a listview and some data and i would like to use some filters
For example: Show all records with id>14
Is there any way to do that?
Thanks in advance.
Not without custom coding it yourself. Under some cases it may require comparing a value from every single item in the listview and that can be very memory intensive.
Here is an example
Code:Dim Tmp As Long
Dim I As Long
Tmp = ListView1.ListItems.Count
For I = 1 To Tmp
If ListView1.ListItems(I).Index > 50 Then
ListView1.ListItems.Remove I
I = I - 1
Tmp = Tmp - 1
If I = Tmp Then Exit For
End If
Next
ComCtl32 Header Control has a FilterBar that will allow you to specify filters for individual columns.
Unfortunately it is not available in the Vb6 ListView.
http://www.vbaccelerator.com/home/VB...ol/article.asp
You can add this header control to VbAccelerator sGrid2:
http://www.vbaccelerator.com/home/vb..._2/article.asp
Based on column filter, Hide/Show Rows in the Grid.
Code:Public Enum cgFilterFlag
cgFilterNone
cgFilterEqual '=
cgFilterNotEqual 'Not=
cgFilterGreaterEqual '>=
cgFilterGreater '>
cgFilterLessEqual '<=
cgFilterLess '<
cgFilterWildcard '* and/or ?
End Enum
Cool!Quote:
Originally Posted by Mxjerrett
Thanks!!