rowcount in grid


is there a way to put a row count somewhere in the grid, possibly in a footer, and for it to always count the number of visible rows - e.g. if there are filter boxes at the top of the grid and the users enters text to filter out rows, it updates the row counter minus the rows that have been filtered out


To recalculate footer’s values you can use “onGridReconstructed” event (availible at PRO version only). To count rows num use getRowsNum() method:

mygrid.attachFooter(“Total rows:,#cspan,#cspan,#cspan,#cspan,




function calculateFooter(){

thanks, that works fine

however, if i have the first column type = “tree”, and use the smartrendering then it does not count the rows of the tree items that are not open

is there a way i can get it to count these as well


To count row which are not open you can use following code:

var s=0;

It will return all rows in grid (including parent and child rows).

what if i wanted to get all visible parent and child rows as you stated, but in the grid i also have a filter and want it to show only the visible rows. the example 2 examples shown either provide me with all visible rows but not of sub children if they folders are not open… or of all rows regardless of the filter


in addition to the question asked above, we have also noticed that the row count is getting counted when a folder is opened but not when it is being closed. for example when we use expandall function it sets the row count fine buit then when we use collapseall function it is not recalcuating the row count


but in the grid i also have a filter and want it to show only the visible rows
With filter enabled the
mygrid.getRowsNum(); - returns count of all visible rows, which exist in grid after filtering
mygrid.getAllSubItems(0).split(",").length; - count of all rows, including ones in closed branches.

By the way, there is a built in counter - … 6090351000

>>buit then when we use collapseall function
We will check the reason of the problem , as fast solution you can use
grid.callEvent(“onGridReconstructed”,[]); //fire event manually

thanks for your reply, i wish we would have been provided with the link at the start of this question… as my original question was asking if there is anything built in and i was provided with a manual way instead. i will now use the built in function. thanks for letting me know