Try to query the DataGrid binding context: DataGrid.BindingContext[DataGrid.DataSource].Count
Or, assuming that the data source is a DataTable and you know something about the data source, you can try ((DataTable)dataGrid1.DataSource).Rows.Count
or the equivalent as well.
source
to share