I have the next code where I defined a WPF toolkit datagrid control called dgQuery; I filled this one with information of a dataset, then I inserted a new checkbox column in
this will return a 'row' in your datagrid
public IEnumerable GetDataGridRows(Microsoft.Windows.Controls.DataGrid grid)
{
var itemsSource = grid.ItemsSource as IEnumerable;
if (null == itemsSource) yield return null;
foreach (var item in itemsSource)
{
var row = grid.ItemContainerGenerator.ContainerFromItem(item) as Microsoft.Windows.Controls.DataGridRow;
if (null != row) yield return row;
}
}
in wpf datagrid, rows are ItemSource.items... no Rows property!
Hope this helps...