Styling TreeGrid

Hi,
I am using Vaadin 14.0.7 and I would like to style any column of a TreeGrid assigning different styles depending of a property value.
I have created a TreeGrid that is used like a menu, and is parametrized with the class “MyColumn” that has an integer attribute “type” that can have 3 possible values (0,1,2).
Depending on the values of “type” I want to assing a class name for styling. For instance, here is a brief snipped of code

public class ProgramMenu extends TreeGrid<MyColumn> {
    public void reload(List<MyColumn> lMyColumn) {
	   //..Some stuff ..//
	   this.addHierarchyColumn(MyColumn:getI18nDescription).setWidth("200px")
				.setClassNameGenerator(
						m->{ 
							String cssClass="";
							switch(m.getType()) {
								case 0: cssClass="edu-main-menu-submenu"; break; //Submenu
								case 1: cssClass="edu-main-menu-action" ; break; //Action
								default:cssClass="edu-main-menu-form";           //	Form
							} 
							System.out.println("Generate menu first column style class....."+ cssClass);
							return cssClass;
						} 
					);
			//.. more stuff ..//		
	}     

When loading the TreeGrid columns, I can see in the console this message in every row that is loaded in the grid

Generate menu first column style class.....edu-main-menu-submenu

But the styles are not applied to any row.

What am I doing wrong?

PD:
I have also tried this code without any success

  1. Apliying this method to the ProgramMenu class
this.setClassNameGenerator(
			m->{ 
				String cssClass="";
				switch(m.getType()) {
					case 0: cssClass="edu-main-menu-submenu"; break; //Submenu
					case 1: cssClass="edu-main-menu-action" ; break; //Action
					default:cssClass="edu-main-menu-form";           //	Form
				} 
				System.out.println("Generate menu first column style class....."+ cssClass);
				return cssClass;
			} 
		);
  1. Using another class
...
this.setClassNameGenerator(new MenuFirstColumnClassGenerator())

and this class is:

public class MenuFirstColumnClassGenerator implements SerializableFunction<MyColumn, String> {
	@Override
	public String apply(MyColumn baseMenuItem) {
		String cssClass="";
		switch(baseMenuItem.getType()) {
			case 0: cssClass="edu-main-menu-submenu"; break; //Submenu
			case 1: cssClass="edu-main-menu-action" ; break; //Action
			default:cssClass="edu-main-menu-form";           //	Form
		} 
		System.out.println("Generate menu first column style class....."+ cssClass);
		return cssClass;
	}
}

Hi,
I have realized that “TreeGrid.addComponentColumn” accepts a Html object as parameter. So while no solution is provided, I have decided to set the “hierarchical column” to an empty value “”, and using the “TreeGrid.addComponentColumn” to fill the tree grid with info and styles

this.addHierarchyColumn(m->"").setWidth("1px");                        // Assign and empty value 
this.addComponentColumn(new MenuFirstColumnValueAndClassGenerator());  // Use the second column as the first column substitute

and for the time being, this workaround solves the problem