Initial load all levels of treegrid

With a treegrid where column data cells are populated on the last level, filtering doesn’t work until you expand to the appropriate rows.

How can I load all the levels of a treegrid initially? Is there a better way to achieve accurate filtering?

You need to expand all the nodes of your treegrid using the expandAll() method:
docs.dhtmlx.com/api__dhtmlxtree … ndall.html

I tried using expandAll() however it does not expand anything. I tried using forEachRow() and openItem() and it worked though I was also unable to retrieve the children. hasChildren() also returns -1 however there are children.

Also, is there a way to simply load it rather than expand and close again? It’s not a very user friendly solution

There are two modes of TreeGrid, static and dynamic.

In static mode, all data is loaded at once, and there must not be any problems with data loading.
In dynamic mode, data is loaded on demand, so client side sorting is not applicable. You can use server side sorting, though.

While it technically possible to force loading of all branches in the dynamic mode, it is not recommended. If you need to have all data on the client side, it is more logical to use a static data loading and to load all data at once.

I tried using forEachRow() and openItem() and it worked t
In case of dynamic data loading, the process is async, so there is a delay between openItem call and moment when data is really available in the treegrid.