As you have discovered, the WPF
DataGrid
does not have a
Rows
property
Try something like this:
foreach (System.Data.DataRowView dr in datagrid.ItemsSource)
{
string t = dr[3].ToString();
if (t =="research_Key")
{
MesssageBox.Show("ok");
}
}
But as @Richard-MacCutchan pointed out -
t
will only be the string from the last row in the DataGrid