You could do something similar to the following.
DataTable dt = new DataTable("MyTable");
dt.Columns.Add("MyColumn", typeof(string));
for (int x = 0; x < 25; x++)
{
dt.Rows.Add(new object[] {x.ToString()});
}
this.dataGrid1.DataSource = dt.DefaultView;
....
DataView dv = this.dataGrid1.DataSource as DataView;
if (dv != null)
{
for (int x = 0; x < dv.Count; x++)
{
if ((string)dv[x].Row["MyColumn"] == "SomeText")
{
this.dataGrid1.CurrentRowIndex = x;
this.dataGrid1.Select(x);
break;
}
}
}
--
Tim Wilson
..Net Compact Framework MVP
"Wiredless" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi
>
> I need to loop through the datagrid rows for a column to search for
specific
> text then make that row visible and or selected. I can do this in a
listview
> fairly easy but i dont see how i can do it with a datagrid 
>
> Any pointers?
>
> Thanks
>
>