I would like to know how many rows are actually displayed by a WPF DataGrid.
I tried looping over DataGridRow and checking IsVisible, but it seems that rows report IsVisible = true even when they are not in the DataGrid viewport.
How can I count the number of visible rows correctly?
I’ve asked this question also on MSDN forum and got a good answer: