Back to TreeGrid home

Example of TreeGrid table with 1 000 000 rows

This example shows using editable, sortable and calculated TreeGrid with very large tables with more than 50,000 rows.

For navigation you can use vertical scrollbar, mouse wheel, arrow keys, PgDn, PgUp, Home, End, Tab.


Related attributes

  • int Paging [0] => 3
    In this example is used server paging with static data files.

  • int PageLength [20] => 100
    Average count of rows in page. For client paging there are all pages created to contain this number of rows (except the last).
    For server paging it determines height of page – it is default value of Count attribute.
    Exact count of rows in pages can differ due to adding or deleting rows or in last incomplete page.
    This value is returned as part of result of count ( ) function in formulas.
    Every page must contain at least one row or is deleted. Exception is when grid does not contain any row, but must contain one page.
    In TreeGrid server is this parameter used to set count of rows in page.

  • int PageLengthDiv [1] => 5
    Page length divider for very large tables (>250 000 root rows) with AllPages==1 and FastPages>0.
    This divides PageLength to display smaller non rendered pages.
    Set this attribute to your rows count / 200 000. For 1 000 000 set it to 5. In this case set PageLength to be enough, for example to 100.
    This attribute is used due problems in some browsers with too high tags (in IE there are problems with tags higher then 5M pixels).

  • int RootCount [] => 1000000
    Count of all rows in root. Used to compute Count parameter of last page when server paging used and pages have not Count attribute set.

  • bool NoPager [0] => 1
    If set to 1, does not render pager. The pager cannot be shown by user. Also does not pre-calculate page names. TreeGrid server does not generate page names and does not send page names to client.

  • int FastPages [0] => 100
    For large tables (> 50 000 root rows). Set it to default value of 100 to speed up rendering of large tables. Bigger value speeds up initial rendering, but can slow down TreeGrid usage and vice versa.


Very large tables

There are few advices how to use TreeGrid for grids with more then about 10 000 root rows. It is not related to huge trees, the tree can handle unlimited count of rows.
All these advices are used only to speed up rendering and using TreeGrid, they do not concern about handling of such amount of rows, TreeGrid can handle unlimited rows count.

For grids with more then 10 000 rows always use server paging (<Cfg Paging=’3’/>). Your server script must provide data for grid’s pages. You can use TreeGrid server component to help you with this task. The TreeGrid server can do nearly all functions required in server paging as creating pages according to sorting and filter settings. Also pre-calculates aggregate functions. Saves changes returned from client. And more.

For grids with more then 50 000 rows use Extra short format to send list of pages. The TreeGrid server does it automatically.
If possible, use all page of the same width and don’t return rows count for every page, but set <Cfg PageLength and RootCount /> attributes. The TreeGrid server does it automatically.
Also increase <Cfg PageLength/> attribute according to count of columns in your grid. For 1 – 5 columns use 100, for 5-10 use 50 and for more columns use 30.
Also use <Cfg FastPages/> attribute. Set it to value about 100. Higher value speeds up initial rendering but can slow down work with the grid and vice versa.

For grids with more then 250 000 rows and all pages visible (<Cfg AllPages=’1’ />) use <Cfg PageLengthDiv/> attribute to reduce page size and all grid scroll height because some browsers have problems with too high scroll height. IE has problems with editing in tag with scroll height higher 5M pixels (about 277 000 rows of standard height). Mozilla has scrolling problems from about the same height.
Set PageLengthDiv to your rows count / 200 000. For 1 000 000 set it to 5.

For grids with more then 2 000 000 rows display only one page at once by using <Cfg AllPages=’0’/>. If you use configuration menu, set <MenuCfg AllPages=’0’/>. Also to suppress loading defaults for AllPages use AllPagesLap=’1’.