Tree grid filtering to only contain child elements values

Hello. 
     I'm trying to use the tree grid filtering and I would like to construct the filter for a column only with the child rows values. I would like to obtain this behavior because the parent row has for my example the total number of child rows, information which I don't need in the filtering. I started off with the Column Template example containing employees provided here https://blazor.syncfusion.com/demos/tree-grid/column-template?_ga=2.265485135.1313622147.1587969672-827250506.1584517392 .
Hope I was explicit enough and looking forward to hearing from you.
Thanks,
Mihai

1 Reply

GL Gowri Loganathan Syncfusion Team April 29, 2020 08:39 AM UTC

  
Hi Mihai, 
 
Thanks for contacting Syncfusion Forum. 
 

Query: Tree grid filtering to only contain child elements values

To achieve your requirement we suggest you to use our HierarchyMode as “Child” in FilterSettings of Treegrid. By default the HierarchyMode is “Parent”. 
 
Code example 
         
<SfTreeGrid DataSource="@TreeData  AllowFiltering="true" IdMapping="TaskId" ParentIdMapping="ParentId"> 
<TreeGridFilterSettings HierarchyMode="@FilterHierarchyMode.Child" ></TreeGridFilterSettings> 
    <TreeGridColumns> 
        <TreeGridColumn HeaderText="Task Details" Width="300"> 
            <TreeGridColumns> 
                         ……………………… . .     
            </TreeGridColumns> 
        </TreeGridColumn> 
    </TreeGridColumns> 
</SfTreeGrid> 
 
@code{ 
……………………… . .     
    protected override void OnInitialized() 
    { 
……………………… . .    } 
 
} 
 
Please refer the below help  documentation link, 
 
Please get back to us, If you need more assistance. 
 
Regards, 
Gowri V L 
 



Loader.
Up arrow icon