Home All Groups Group Topic Archive Search About
Author
22 Aug 2006 11:21 PM
Mark
Hello,

How do you search a datagridview for given column values?

Any help would be greatly appreciated!
Thanks in advance

Author
23 Aug 2006 3:10 AM
gene kelley
On Tue, 22 Aug 2006 16:21:01 -0700, Mark <M***@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
Author
23 Aug 2006 5:28 AM
Cor Ligthert [MVP]
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

Show quoteHide quote
"gene kelley" <o***@by.me> schreef in bericht
news:467ne2l2b7202je98i7hbr2bi6m7rrvje4@4ax.com...
> On Tue, 22 Aug 2006 16:21:01 -0700, Mark <M***@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
Author
24 Aug 2006 3:43 AM
gene kelley
On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote:

>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


Show quoteHide quote
>I would have written your first sentence if you had not done it already.
>
>Cor
>
>"gene kelley" <o***@by.me> schreef in bericht
>news:467ne2l2b7202je98i7hbr2bi6m7rrvje4@4ax.com...
>> On Tue, 22 Aug 2006 16:21:01 -0700, Mark <M***@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
>
Author
24 Aug 2006 6:00 AM
Cor Ligthert [MVP]
Gene,

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

Cor

Show quoteHide quote
"gene kelley" <o***@by.me> schreef in bericht
news:at7qe2hfns560oq8jh91guf9uhfsm0g9fc@4ax.com...
> On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
> <notmyfirstn***@planet.nl> wrote:
>
>>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" <o***@by.me> schreef in bericht
>>news:467ne2l2b7202je98i7hbr2bi6m7rrvje4@4ax.com...
>>> On Tue, 22 Aug 2006 16:21:01 -0700, Mark
>>> <M***@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
>>
Author
24 Aug 2006 7:54 AM
gene kelley
On Thu, 24 Aug 2006 08:00:16 +0200, "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote:

>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


Show quoteHide quote
>"gene kelley" <o***@by.me> schreef in bericht
>news:at7qe2hfns560oq8jh91guf9uhfsm0g9fc@4ax.com...
>> On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
>> <notmyfirstn***@planet.nl> wrote:
>>
>>>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" <o***@by.me> schreef in bericht
>>>news:467ne2l2b7202je98i7hbr2bi6m7rrvje4@4ax.com...
>>>> On Tue, 22 Aug 2006 16:21:01 -0700, Mark
>>>> <M***@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
>>>
>
Author
24 Aug 2006 10:08 AM
Cor Ligthert [MVP]
Gene,

I did not know this, thanks,

Cor

Show quoteHide quote
"gene kelley" <o***@by.me> schreef in bericht
news:mqlqe2h70gl5hbbboascge7obp3g067015@4ax.com...
> On Thu, 24 Aug 2006 08:00:16 +0200, "Cor Ligthert [MVP]"
> <notmyfirstn***@planet.nl> wrote:
>
>>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" <o***@by.me> schreef in bericht
>>news:at7qe2hfns560oq8jh91guf9uhfsm0g9fc@4ax.com...
>>> On Wed, 23 Aug 2006 07:28:52 +0200, "Cor Ligthert [MVP]"
>>> <notmyfirstn***@planet.nl> wrote:
>>>
>>>>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" <o***@by.me> schreef in bericht
>>>>news:467ne2l2b7202je98i7hbr2bi6m7rrvje4@4ax.com...
>>>>> On Tue, 22 Aug 2006 16:21:01 -0700, Mark
>>>>> <M***@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
>>>>
>>