hi my friends :) , how i can filter data in listview.Not the best component in my opinion.
i use the component "ListViewFilterEdit1" linked to listview, but while write some text the listview Everything is cleaned.
@EricktuxSwitch to VirtualStringTree. More options, lot faster, you can hide each row individually, etc:
some idea my friends...
VirtualStringTree can use images and filters ?Yes.
The component Works in windows, linux and mac ?Yes.
you example work fine, I just corrected a detail, I show you an image.Yes, I forget about that. I use a slightly customized VST.
my friend one question...See attachment.
how i can filter all columns (name, ocupation, year, married)
Not the best component in my opinion.No, the idea of the FilterEdit controls is that they own the data and take control of it, copying it to the actual GUI control as needed.
You need set property ByAllFieldsBecause to True, because it's filtering only by Caption property default, which are empty, or set Caption for each item.
When changing ListView (load data):
1. Before change detach the ListView from Edit (ListViewFilterEdit1.FilteredListview := nil).
2. Do Edit.Items.Clear and also Edit.Clear.
3. Attach ListView to Edit after change (ListViewFilterEdit1.FilteredListview := ListView1).
And last - it's save only strings, so you image indexes will be lost :'(Yes, the image support is still missing. I first made a very basic version for use in some IDE windows. Then (I think) Ondrej added support for data pointers.
The only thing that I can't figure out is how to capture when the 'Clear' button is pressed.There are events like OnButtonClick, OnChange and many others.
I want to grey out the option to edit the ListView when the filter is being used and enable it again when the filter is cleared.
OnButtonClick may not be enough because the filter can be emptied also by delete or backspace.Good point. I'll see if I can check whether the edit box is empty instead.
The OnButtonClick event doesn't seem to work for this component.It is triggered here. No problems.
I insertedinto the OnButtonClick procedure to see if it was being triggered but apparently not.
ShowMessage('test');