943,928 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 53949
  • VB.NET RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 4th, 2007
1

To Search a record in datagridview

Expand Post »
hi friends...
i want to search a record from a datagridview with an input box...
Can anyone help me plz...
It's 4 my project ...
Need help plzzzz...
Similar Threads
Reputation Points: 8
Solved Threads: 0
Junior Poster in Training
geetajlo is offline Offline
72 posts
since Sep 2007
Nov 4th, 2007
0

Re: To Search a record in datagridview

So you need to type the parameter in a input box to filter the Grid?
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Nov 4th, 2007
0

Re: To Search a record in datagridview

Are you using VS 2003 or VS 2005?

Database SQL or Access?
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Nov 4th, 2007
0

Re: To Search a record in datagridview

Click to Expand / Collapse  Quote originally posted by geetajlo ...
hi friends...
i want to search a record from a datagridview with an input box...
Can anyone help me plz...
It's 4 my project ...
Need help plzzzz...
Ok, what's the problem? Assume you want your users to enter a term in a textbox then you will search for that term. Is that correct? Give a little more info on the issue and what you need.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
vcombstlh is offline Offline
1 posts
since Aug 2007
Nov 5th, 2007
0

Re: To Search a record in datagridview

VS 2005 et database Access
Reputation Points: 8
Solved Threads: 0
Junior Poster in Training
geetajlo is offline Offline
72 posts
since Sep 2007
Nov 5th, 2007
0

Re: To Search a record in datagridview

You could loop through the rows in the datagridview ? Or maybe re-query the datasource?

Dim intcount As Integer = 0
For Each Row As DataGridViewRow In DataGridView1.Rows
If DataGridView1.Rows(intcount).Cells(0).Value = "StringSearch" Then
'Do Something
intcount +=1
End If
Next Row
Last edited by Triss; Nov 5th, 2007 at 4:41 am.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Triss is offline Offline
15 posts
since Nov 2007
Nov 5th, 2007
0

Re: To Search a record in datagridview

Do you want to search a particuar column from the DB or just any text in the Grid?
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Nov 5th, 2007
0

Re: To Search a record in datagridview

Text in the grid... I think they mean... ?
Last edited by Triss; Nov 5th, 2007 at 11:01 am.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
Triss is offline Offline
15 posts
since Nov 2007
Nov 5th, 2007
0

Re: To Search a record in datagridview

You Can use something like this using DataView

Dim dv As New DataView(ds.Tables(0))
dv.RowFilter = "FirstName = '" & TextBox1.Text & "'"
DataGrid1.DataSource = dv

You can replace the Textbox2.text to the value returned from the inputbox.
Reputation Points: 25
Solved Threads: 18
Practically a Master Poster
binoj_daniel is offline Offline
645 posts
since Dec 2006
Nov 6th, 2007
0

To Search a record in datagridview

hi thanks it works...
the search works, it select only the fullrows containing the firstname i type in the input box but all the other data disappear.
i don't want it to disapppear, i want it to be in the datagrid..
help me plz
Reputation Points: 8
Solved Threads: 0
Junior Poster in Training
geetajlo is offline Offline
72 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
This thread is currently closed and is not accepting any new replies.
Previous Thread in VB.NET Forum Timeline: Scientific Data Parsing using a 3 dimensional Array
Next Thread in VB.NET Forum Timeline: Change TxtBox Content to TextFile





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC