This is a migrated thread and some comments may be shown as answers.

Foreign Key Ability

1 Answer 182 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 03 Oct 2019, 06:33 PM

Was is the best way/practice to extend the TreeList class to have the same foreign Key Functionality of the grid?

 

ex. https://demos.telerik.com/aspnet-core/grid/foreignkeycolumn

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 08 Oct 2019, 09:34 AM

Hi Rob,

You could apply the same behavior to a TreeList as the Grid's ForeignKey column implementation by creating an Editor Template, which will be bound to а specific column. To achieve that:

1. Create an editor template and add it to the ~/Views/Shared/EditorTemplates folder of the project:
@(Html.Kendo().DropDownListFor(m => m)
    .BindTo(new List<string>() { "Last Name 1", "Last Name 2", "Last Name 3", "Last Name 4" })
    )

2. Refer it by using the UIHint attribute:

[UIHint("CustomEditorDropDown")]
public string LastName { get; set; }

For your convenience, I am attaching a small project demonstrating the above approach. Please review it and let me know if you have any questions.

Regards,
Nikolay
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
TreeList
Asked by
Rob
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or