TreeList Filtering: Set criteria through Code

1 Answer 7 Views
TreeList
Joel
Top achievements
Rank 3
Bronze
Iron
Iron
Joel asked on 15 Jul 2025, 09:43 PM

How do I set the TreeList filter through code?  So, can I put a value in the criteria field from code behind?

My TreeList
                <TelerikTreeList @ref=@TreeListRef
                                 Data="@Groups"
                                 SelectedItems="@SelectedGroups"
                                 IdField="@nameof(Group.Id)"
                                 ParentIdField="@nameof(Group.ParentId)"
                                 OnStateInit="((TreeListStateEventArgs<Group> args) => OnStateInitHandler(args))"
                                 Pageable="true"
                                 PageSize="@GroupPageSize"
                                 Height="100%"
                                 Sortable="false"
                                 SelectionMode="TreeListSelectionMode.Single"
                                 FilterMode="@TreeListFilterMode.FilterMenu"
                                 @bind-Page="@GroupCurrentPage"
                                 SelectedItemsChanged="@((IEnumerable<Gsi.Customer.Models.Group> m) => OnGroupSelected(m))">
                    <TreeListColumns>
                        <TreeListColumn Field="Name" Title="Group Filter" Expandable="true">
                            <Template>
                                @{
                                    var item = context as Gsi.Customer.Models.Group;
                                    <img height="32" width="32" src="@item.ImageUrl" />
                                    @item.Name
                                }
                            </Template>
                        </TreeListColumn>
                    </TreeListColumns>
                </TelerikTreeList>

1 Answer, 1 is accepted

Sort by
1
Georgi
Telerik team
answered on 17 Jul 2025, 02:04 PM

Hello Joel,

Thanks for reaching out about programmatically setting filter criteria for the TelerikTreeList component. 

I'm providing an example using the Telerik Blazor REPL platform so you can easily view, run, and modify the code as needed. It demonstrates how to programmatically apply filters.

You can also find a similar example and more details in the TelerikTreeList component documentation.

This resource should provide everything you need to get started.

I hope this helps. If you have any questions, please do not hesitate to reach out.

Regards,
Georgi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Joel
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 17 Jul 2025, 04:34 PM

Yep, thanks.
Tags
TreeList
Asked by
Joel
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Georgi
Telerik team
Share this question
or