TreeList Editor Template

1 Answer 103 Views
TreeList
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Renier Pretorius asked on 29 Apr 2021, 09:52 AM

Hi,

Is it possible to specify different editor templates for different levels in hierarchical data?

What I am trying to do is to build a hierarchical structure for grouping items. The list of items is specified so, in the grouping hierarchy, I want to select an item as the child element of the lowest grouping level rather than typing the name of the item and resolving if it exists. I thus want for the lowest level, to have a combobox rather than an editbox. The data items presented in the treelist have a property to bind to.

Thanks for any suggestions.

Renier Pretorius

1 Answer, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 30 Apr 2021, 12:43 PM

Hello Renier,

I made this public page on your behalf where you can Follow the implementation of such functionality in the component: https://feedback.telerik.com/blazor/1517790-different-editor-templates-for-different-levels. If your models already have some distinction (flag) in them, you can already use it with some conditional markup in the editor template.

Regards,
Marin Bratanov
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.

Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
commented on 30 Apr 2021, 12:51 PM

Hi Marin,

I ended up creating a custom onclick eventhandler for the edit command and based on the level of the relevant item, either return so that the default edit action follows or set the iscancelled flag on the eventarg and launch a modal window with a selection grid. This also enabled me to select multiple items to create multiple child elements in the treelist at the same time.

I will bear the conditional markup in mind for future use cases

Regards
Renier
Marin Bratanov
Telerik team
commented on 30 Apr 2021, 01:26 PM

That's a perfectly valid solution, cancelling a built-in command is a great way to customize the behavior of the component.
Tags
TreeList
Asked by
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Marin Bratanov
Telerik team
Share this question
or