How can I get the list of rows in the DataGrid? Not the bound items, but the
DataGridRows
list.
I need to control the visibility of these rows and it's only possible to control it as a DataGridRow
and not as a data object.
Thanks!
You can get the row using ItemContainerGenerator. This should work -
for (int i = 0; i < dataGrid.Items.Count; i++)
{
DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator
.ContainerFromIndex(i);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With