If you are talking about Grid Layout then it would be
int gridRow = grid.RowDefinitions.Count;
If you are talking about DataGrid introduced in WPF 4 (.Net 4.0 Beta 2) then it would be
int dataGridRow = datagrid.Items.Count;
Here gridRow and dataGrid row are the name of the variables Grid and DataGrid respectively.
Zeeshan Amjad
http://zamjad.wordpress.com/