Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
Hi,

Filter the listview based on text entered in textbox.
If I enter "ha" it should match with name field and display listview if any records else raise a error.
Posted
Updated 25-Oct-10 21:47pm
v2
Comments
Arindam Tewary 26-Oct-10 2:15am    
What are you looking for? You have no query at all .... you understand the rerquirement pretty clearly !! Start implementing .. :-)
krishna kishore58 26-Oct-10 3:36am    
suggest me with appropiate ans.. i know the req but i donno how to implement n dats the im asking u..
Dalek Dave 26-Oct-10 3:47am    
Edited for Grammar and Readability.

1 solution

Have a look at this[^] MSDN article.
The first example (To find an item using text) from the article demonstrates the usage ListView.FindItemWithText[^] method. :)

[EDIT AFTER OP COMMENT]
You wanted to filter a ListView based on a text entered in TextBox. I gave you a link with example that does exactly what you want.
Now you want from me to suggest an answer for your question. My answer is the same, because the question is the same. If you elaborate and explain what is your specific problem I'll do my best in order to help you but with given information from you, that is all I can do.
[/EDIT]
 
Share this answer
 
v3
Comments
Dalek Dave 26-Oct-10 3:47am    
I think you worked out what he was after, well done!
krishna kishore58 26-Oct-10 3:56am    
suggest the answer for above question..
Nuri Ismail 26-Oct-10 7:20am    
That is my suggestion for your question. Check out the MSDN article from the provided link. And use the first example to achieve your goal.
krishna kishore58 27-Oct-10 4:57am    
Thanks 4 ur reply. I'm fetching only one value that too in msgbox. I dont require this.
When i enter substring in textbox and when press enter, it should match with Name column of listview and listview should display all the rows that are matched else raise error.

eg:
if i enter "t" in textbox..it should match with Name column of listview and display all the rows that are matched else raise error.
Hope now it's clear to u..Plz reply soon

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900