Tree Grid Sorting

Hi everybody.

I’ve a problem with treegrid sorting. In a simple treegrid with two levels like this:

PARENT
CHILD 1
CHILD 2
CHILD 3

i load the tree in php with tree->dynamic_loading(true) in this way:

treegrid.load(“php/treegrid.php”, function(id) {
treegrid.forEachRow(function(id) {
treegrid.OpenItem(id);
});
treegrid.sortTreeRows(0,“str”,“asc”);
});

As you can see after grid loading i use a “foreach” to open all the children, that are not alphabetically sorted from the source, and i need to sort them with last command. This function “sortTreeRows” seems non having effect on children while clicking on column header the sorting runs. I don’ t understand why.

Thank you for your answer.

solved !

I use sortTreeRows in the XLE event of my Grid and all runs correctly.

Tanks the same and … at next problem !