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\'
I recommend defining a Style for DataGridRow that will have its Visibility bound to whether it should be displayed or not. Just iterating through the rows won't be enough, as I mentioned in @RV1987's answer.
EDIT:
What you bind to depends on where you hold the information of whether or not you should display the row. For example, if each data object in your bound collection has a bool ShouldBeDisplayed property, you would have something like this: