|
-
Dec 16th, 2003, 05:31 PM
#1
Thread Starter
Junior Member
how to create search for datagrid
Is there any way to create a search using a text box where someone could type in part of what they are looking for and it can search one field in my datagrid and if it finds the search criteria, go to that record in the grid ?
Any help is greatly appreciated. Thanks
--
Tony
-
Dec 16th, 2003, 10:57 PM
#2
Thread Starter
Junior Member
clarification
I thought I would clarify what I am looking to do.
I do not want to filter the recordset on a search value.
I want to look for a search string in a field of my dataset, and if found, move to that record in my datagrid. I am searching based on partial values also. So if a record is as follows:
field 1=ENT
field 2=Backing Soda
I would like to search field 2 for "soda" and move to the first record containing that value. If I click again to search it will look from that point in the database on, and if it is found move to that record. And on and on until it hits the bottom of the dataset and them display "no more records found" kind of thing
Can this be done ?
Thanks
-
Dec 16th, 2003, 11:30 PM
#3
PowerPoster
look at the documentation for a dataview. Then bind the grid to that.
-
Dec 17th, 2003, 12:46 AM
#4
Thread Starter
Junior Member
I did find the information on dataview in the vb.net documentation but it seems that I can only search by a whole field and not by part.
-
Dec 17th, 2003, 01:13 AM
#5
PowerPoster
No, you can specify something like this:
field 2 LIKE %Soda%
I believe. I haven't tested that code, but something like it should work.
This link should help start you out...
http://p2pforum.wileypub.com/topic.asp?TOPIC_ID=6537
-
Dec 17th, 2003, 02:06 PM
#6
Thread Starter
Junior Member
I appreciate the help but I am not looking to filter the records.
All I want to do is look for the search term in a field then if found go to that record.
I do not want to do any sorting selecting or anythign of that kind
-
Dec 18th, 2003, 08:27 AM
#7
Hyperactive Member
did you mean, search an exisiing populated datagrid and position to that record? and perhaps highlight it?
-
Dec 18th, 2003, 01:16 PM
#8
Thread Starter
Junior Member
That is correct. I have populated my datagrid upon program load and just want to search the grid for the search text and goto that record if found
-
Dec 11th, 2007, 12:23 PM
#9
Addicted Member
Re: how to create search for datagrid
Anyone have a solution for this?
Hello? Underpaid code monkey speaking...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|