total rows in the grid

hi

how can i get total number of rows in the grid plz help me

var total = mygrid.getRowsNum();

please beware that it work for plain grids only ( not for treeGrid )