Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
I need c# code for a desktop application that i am developing,i need help for the search function.It must seearch by name only.I have been looking all over google but have found nothing.I dont want want code for a web page,itis simply a desktop application
Thanks in advance
Posted
Comments
Mehdi Gholam 12-Oct-11 7:02am    
What do you want to search for in your desktop app?
Anil Honey 206 12-Oct-11 7:06am    
You want to search Data in Gridview or any other Control so we can Help you.
hlubi.teegurl 12-Oct-11 7:18am    
i want to search data in a gridview.i want to search by name in that gridview

1 solution

use search string for filtering,
if I have text-box namely (txtName) where I am entering my search string
& datafield name in datagrid is dgName then

create string as " dgName like ' " + trim(txtName.text) + " %'"
then create a dataview with data source from Datagrid
use dataview.rowfilter command & pass created string to this
then again bind same dataview to grid
 
Share this answer
 

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