How to get all DataGridRows in DataGrid? like
foreach (DataGridRow dr in postQueue.Items)
{
Console.WriteLine(dr.GetIndex());
}
of cource wrong, because i need every DataGridRow element, not struct.
for (int i = 0; i < postQueue.Items.Count; i++)
{
DataGridRow row = (DataGridRow)postQueue.ItemContainerGenerator
.ContainerFromIndex(i);
row.Header = i.ToString();
}
Throws
row was null