tree grid help

I trying to use treegrid, first I catch all the code in demo and put in my app, but the tree grid don`t show the childs, he only show the first time…

so now I tryng to create my ow DemoContainer just like this:

public class DemoContainer extends HierarchicalContainer implements Collapsible, Measurable {

    static final String PROPERTY_NAME = "Name";
    static final String PROPERTY_HOURS = "Hoursdone";

    public DemoContainer() {
        super.addContainerProperty("Name", String.class, "");
        super.addContainerProperty("Hoursdone", String.class, "");

    public Item addItem(TbCategoriaReceitaDespesa categoria){
        Item r =  super.addItem(categoria);
        return r;

    public void addChildren(TbCategoriaReceitaDespesa categoria, TbCategoriaReceitaDespesa parent){
       Item r = addItem(categoria);


    public void setCollapsed(Object o, boolean b) {
        System.out.println("entrou 1");

    public boolean isCollapsed(Object o) {
        System.out.println("entrou 2");
        return true;

    public int getDepth(Object o) {
        return 0;

But in my Code I can`t add children he put below the parent and not inside.

how can I fix this?


this is my screen when I use the hole demo in my app,