Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

How to code incremental search

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rh - 14 Dec 2004 18:03 GMT
Hi, I'd like to add an incremental search to my windows form DataGrid that
works like the one used in Windows Explorer.

In Windows Explorer, when you type a character it jumps to the first item
that matches that character. If you type another letter within a given
amount of time it will be part of the same search so that it will match the
first 2 characters and so on. If you wait long enough and then type another
character, it will treat it as a new search.

Any info, links, or sample code to help me do this would be appreciated.
Thanks in advance!
Rajesh Patel - 14 Dec 2004 21:50 GMT
It may not perfect solution you are looking for but,

You can put a textbox above datagrid for search. Where user will type his
search value, as user type it will fire textchanged event. in that event you
can make corresponding rows visible and selected in datagrid.

Regards,
Rajesh Patel

> Hi, I'd like to add an incremental search to my windows form DataGrid that
> works like the one used in Windows Explorer.
[quoted text clipped - 7 lines]
> Any info, links, or sample code to help me do this would be appreciated.
> Thanks in advance!
Ken Tucker [MVP] - 14 Dec 2004 21:51 GMT
Hi,

           Take a look at the dataviews find method.  Here is a sample I
wrote
http://www.onteorasoftware.com/downloads/dataviewfind.zip

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cp
consearchingdataview.asp


Ken
-------------------
Hi, I'd like to add an incremental search to my windows form DataGrid that
works like the one used in Windows Explorer.

In Windows Explorer, when you type a character it jumps to the first item
that matches that character. If you type another letter within a given
amount of time it will be part of the same search so that it will match the
first 2 characters and so on. If you wait long enough and then type another
character, it will treat it as a new search.

Any info, links, or sample code to help me do this would be appreciated.
Thanks in advance!
Antony Baula - 16 Dec 2004 15:17 GMT
You should handle OnKey(Up/Down) event.
If you'll be more specific I'll try be the same.

> Hi, I'd like to add an incremental search to my windows form DataGrid that
> works like the one used in Windows Explorer.
[quoted text clipped - 7 lines]
> Any info, links, or sample code to help me do this would be appreciated.
> Thanks in advance!
rh - 16 Dec 2004 21:14 GMT
Thanks for the info. Handling the OnKey(Up/Down) seems like a good place to
start. Here are more details:

It seems that the incremental seach feature built into Windows Explorer also
has some sort of timer built into it. I would like to know how to build a
similar timer into my incremental search feature.

Also, the DataGrid I'm building will be read only and will have more then
one column. So, whatever column the user clicks and starts typing in, I
would like the search to apply to that column only. Info on how to: a)find
out which column was clicked b)perform the search on that column only and
c)highlight the matching row, would be appreciated.

> You should handle OnKey(Up/Down) event.
> If you'll be more specific I'll try be the same.
[quoted text clipped - 10 lines]
>> Any info, links, or sample code to help me do this would be appreciated.
>> Thanks in advance!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.