473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Datagridview Search?

Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance
Aug 22 '06 #1
6 18901
On Tue, 22 Aug 2006 16:21:01 -0700, Mark <Ma**@discussions.microsoft.comwrote:
>Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance
1) If the control is bound to an underlying DataTable or DataSet, it would be better to search there
rather than search the control.

2) If unbound, you would have to iterate through all the rows looking for the specified column value
using somthing like this:

If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as String).Value = MyValue Then

End If

Gene
Aug 23 '06 #2
Gene,

AFAIK can a DataGridView not be used unbound althouhg it should be easier
than with the DataGrid to bind it to another object.

I would have written your first sentence if you had not done it already.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:46********************************@4ax.com...
On Tue, 22 Aug 2006 16:21:01 -0700, Mark <Ma**@discussions.microsoft.com>
wrote:
>>Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance

1) If the control is bound to an underlying DataTable or DataSet, it would
be better to search there
rather than search the control.

2) If unbound, you would have to iterate through all the rows looking for
the specified column value
using somthing like this:

If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as
String).Value = MyValue Then

End If

Gene

Aug 23 '06 #3
On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]" <no************@planet.nlwrote:
>Gene,

AFAIK can a DataGridView not be used unbound althouhg it should be easier
than with the DataGrid to bind it to another object.
I'm not sure what you are trying to say in the above sentence. Are you asking how the DataGridView
is used with unbound data?
Gene

>I would have written your first sentence if you had not done it already.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:46********************************@4ax.com.. .
>On Tue, 22 Aug 2006 16:21:01 -0700, Mark <Ma**@discussions.microsoft.com>
wrote:
>>>Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance

1) If the control is bound to an underlying DataTable or DataSet, it would
be better to search there
rather than search the control.

2) If unbound, you would have to iterate through all the rows looking for
the specified column value
using somthing like this:

If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as
String).Value = MyValue Then

End If

Gene
Aug 24 '06 #4
Gene,

In my idea that is impossible yes, therefore maybe you can show it with a
sample.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:at********************************@4ax.com...
On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
<no************@planet.nlwrote:
>>Gene,

AFAIK can a DataGridView not be used unbound althouhg it should be easier
than with the DataGrid to bind it to another object.
I'm not sure what you are trying to say in the above sentence. Are you
asking how the DataGridView
is used with unbound data?
Gene

>>I would have written your first sentence if you had not done it already.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:46********************************@4ax.com. ..
>>On Tue, 22 Aug 2006 16:21:01 -0700, Mark
<Ma**@discussions.microsoft.com>
wrote:

Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance

1) If the control is bound to an underlying DataTable or DataSet, it
would
be better to search there
rather than search the control.

2) If unbound, you would have to iterate through all the rows looking
for
the specified column value
using somthing like this:

If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as
String).Value = MyValue Then

End If

Gene

Aug 24 '06 #5
On Thu, 24 Aug 2006 08:00:16 +0200, "Cor Ligthert [MVP]" <no************@planet.nlwrote:
>Gene,

In my idea that is impossible yes, therefore maybe you can show it with a
sample.

Cor
There is a trivial example in the Help file:
Walkthrough: Creating An Unbound Windows Forms DataGridView Control

Gene

>"gene kelley" <ok**@by.meschreef in bericht
news:at********************************@4ax.com.. .
>On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
<no************@planet.nlwrote:
>>>Gene,

AFAIK can a DataGridView not be used unbound althouhg it should be easier
than with the DataGrid to bind it to another object.
I'm not sure what you are trying to say in the above sentence. Are you
asking how the DataGridView
is used with unbound data?
Gene

>>>I would have written your first sentence if you had not done it already.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:46********************************@4ax.com ...
On Tue, 22 Aug 2006 16:21:01 -0700, Mark
<Ma**@discussions.microsoft.com>
wrote:

>Hello,
>
>How do you search a datagridview for given column values?
>
>Any help would be greatly appreciated!
>Thanks in advance

1) If the control is bound to an underlying DataTable or DataSet, it
would
be better to search there
rather than search the control.

2) If unbound, you would have to iterate through all the rows looking
for
the specified column value
using somthing like this:

If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as
String).Value = MyValue Then

End If

Gene
Aug 24 '06 #6
Gene,

I did not know this, thanks,

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:mq********************************@4ax.com...
On Thu, 24 Aug 2006 08:00:16 +0200, "Cor Ligthert [MVP]"
<no************@planet.nlwrote:
>>Gene,

In my idea that is impossible yes, therefore maybe you can show it with a
sample.

Cor
There is a trivial example in the Help file:
Walkthrough: Creating An Unbound Windows Forms DataGridView Control

Gene

>>"gene kelley" <ok**@by.meschreef in bericht
news:at********************************@4ax.com. ..
>>On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
<no************@planet.nlwrote:

Gene,

AFAIK can a DataGridView not be used unbound althouhg it should be
easier
than with the DataGrid to bind it to another object.

I'm not sure what you are trying to say in the above sentence. Are you
asking how the DataGridView
is used with unbound data?
Gene
I would have written your first sentence if you had not done it already.

Cor

"gene kelley" <ok**@by.meschreef in bericht
news:46********************************@4ax.co m...
On Tue, 22 Aug 2006 16:21:01 -0700, Mark
<Ma**@discussions.microsoft.com>
wrote:
>
>>Hello,
>>
>>How do you search a datagridview for given column values?
>>
>>Any help would be greatly appreciated!
>>Thanks in advance
>
1) If the control is bound to an underlying DataTable or DataSet, it
would
be better to search there
rather than search the control.
>
2) If unbound, you would have to iterate through all the rows looking
for
the specified column value
using somthing like this:
>
If Me.MainGridView.Rows(Index as Integer).Cells(ColumnName as
String).Value = MyValue Then
>
End If
>
Gene

Aug 24 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Job Lot | last post by:
How can I filter/search records in DataGridView after filling it with data? The BindingNavigator provides default functionality for navigating, adding, deleting and saving records. Is there...
2
by: The Other Mike | last post by:
VS 2005 Is their a way to dynamically change the where clause in a datagridview or dataset? I have a search window where the user can enter a part number or description or customer etc... and...
3
by: Prashwee | last post by:
Hello All In my windows application I am using DataGridView as my grid control. I populated let's say 10 rows of data and modified 3 random rows. I need to put some sort of Edit Marker in the...
3
by: Johnny E. Jensen | last post by:
Hello Dot sure if this it the right group but here goes. I'am using the DataGridView multiple times in my application, and then i'll read a book on inherience, and that opend a new world for...
3
by: Freddy Coal | last post by:
Hi, I'm learning to use the Datagridview; I would like sort a column of my DGV, but with code, not with user click over the column, how make that?; Mi other question is how search for a especific...
3
by: Richard Lewis Haggard | last post by:
I have an unbound DataGridView control that has some cells that may contain more multi-line text than can be completely displayed in the available screen space. When the height of its row to...
5
by: =?Utf-8?B?bWljaGFlbCBzb3JlbnM=?= | last post by:
I want to be able to increase or decrease row heights of a populated DataGridView from the keyboard. I set up a test program with menu items to increase and decrease, assigned shortkey keys...
6
by: akshaycjoshi | last post by:
I have one datagridview which i fill using the connected verion of ADO.NET. When the user presses the search button a seperate thread is created and in that thead i connect to the database and fill...
5
by: BabliS1 | last post by:
I am using Vb.net2005. I have a datagridview which displays some data. I want to filter the records based on some criteria given by the user at runtime. How can I do this. Please Help. Thanks in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.