Robert,
There are a number of things that are going to influence the answer
here.
The first is, are you using a consistent data source? Are you always
binding to a datatable/dataview with the same schema, or are you sometimes
binding to a list or something of that nature? If the underlying data is
going to change, or not consistent (or you have abstracted it out so you
don't have access to the original structure), then you have to cycle through
the rows/cells in a brute-force manner. Brute-force is required if the data
is not ordered according to your search criteria (in this example, if the
data is not sorted on the name, then you can't really search quickly).
If you have access to the underlying data, then it's a little easier,
since you can use the methods native to the data container to search, and
then change your selection appropriately. For example, if you are bound to
a data table, then you can call the Select method to figure out which row
corresponds to the search criteria (and then select it).
However, this is only the case if the view on the data matches the
underlying data. If you allow the user to sort the data, then you can't
access the datatable, but rather, you have to access the view that the grid
is bound to, and then search on that.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi all,
>
[quoted text clipped - 9 lines]
> Thanks
> Robert