Search in TreeGrid

Hi everyone. Is it possible to search in TreeGrid? Not only for the parent entries, but also for the child entries. I want to be able to search for the name of child entries. And on text field change to filter the info that i need.

This is what i have done. I created a TreeGrid and a TextField for searching. At the moment the search is working only for the parent entries.
I am using Vaadin 8.4.3


Name			Type

2017 Projects	100

-Project1		20	

-Project2		30

-Project3		50

2018 Projects	50

-Project4		30

-Project5		20

If i search for 2017 Projects - should display

2017 Projects	100

-Project1		20	

-Project2		30

-Project3		50

If i search for for Project1 - should display

2017 Projects	100

-Project1		20	

or just

-Project1 20

TreeGrid POJO:

public class TreeGridDTO {

    private String name;

    private String type;

    private List<TreeGridDTO> internalList;

    public TreeGridDTO(String name, String type){ = name;
        this.type = type;
        this.internalList = new ArrayList<>();


    public String getName() {
        return name;

    public void setName(String name) { = name;

    public String getType() {
        return type;

    public void setType(String type) {
        this.type = type;

    public void addToInternalList(TreeGridDTO treeGridDTO){

    public List<TreeGridDTO> getInternalList() {
        return internalList;

	//creating the TreeGrid
	TreeGridDTO treeGridDTO1 = new TreeGridDTO("2017 Projects","100");
    TreeGridDTO treeGridDTO2 = new TreeGridDTO("Project1","20");
    TreeGridDTO treeGridDTO3 = new TreeGridDTO("Project2","30");
    TreeGridDTO treeGridDTO4 = new TreeGridDTO("Project3","50");

    TreeGridDTO treeGridDTO5 = new TreeGridDTO("2018 Projects","50");
    TreeGridDTO treeGridDTO6 = new TreeGridDTO("Project4","30");
	TreeGridDTO treeGridDTO7 = new TreeGridDTO("Project5","20");
	List<TreeGridDTO> treeGridDTOList = new ArrayList<>();
	TreeGrid<TreeGridDTO> grid = new TreeGrid<>();
    grid.setItems(treeGridDTOList, TreeGridDTO::getInternalList);
	//search method
	private List<TreeGridDTO> doSearchBasic(String searchCriteria) {

               .filter(treeGridDTO -> treeGridDTO.getName().toLowerCase().contains(searchCriteria.toLowerCase()))
	// text field for search
	TextField tfSearch = new TextField();
	tfSearch.addValueChangeListener(valueChangeEvent -> {
         grid.setItems(doSearchBasic(valueChangeEvent.getValue()), TreeGridDTO::getInternalList);

I think you just want filtering for your dataprovider. See here: