foreign-key-column not work in tag-helper, please help.

1 Answer 8 Views
Grid
Vincent
Top achievements
Rank 1
Vincent asked on 16 May 2021, 02:13 AM

html-helper work correct, but tag-helper does not work, 2021R1

my code as follow:

@{
    ViewData["Title"] = "UserManager";
    Layout = "~/Pages/_Layout.cshtml";
    IEnumerable<ComboBoxItemBase> listDept = Model.ds.Osdept.OrderBy(q => q.Deptname).Select(q=> new ComboBoxItemBase() { Id=q.Id, Text=q.Deptname }).ToList().AsEnumerable();
}

<kendo-grid name="DgUser" resizable="true"
                selectable="true" style="height:calc(100vh - 270px)"
                navigatable="true" on-edit="DgUserEdit">
        <filterable enabled="false" />
        <sortable enabled="true" />
        <editable enabled="true" />
        <columns>

            <foreign-key-column title="department" field="DeptId" values='@listDept' value-field="Id" text-field="Text" width="150" >
            </foreign-key-column>
    </columns>
    </kendo-grid>

 

@(Html.Kendo().Grid<Models.AspNetUsers>()
    .Name("DgUserX")
    .Columns(columns =>
    {
        columns.Bound(p => p.UserName);
        columns.ForeignKey(p => p.DeptId, listDept, "Id", "Text")
            .Title("Category").Width(150);
    })
    .Filterable()
    .Groupable()
    .Pageable()
    .Scrollable()
    .HtmlAttributes(new { style = "height:430px;" })
)

 

1 Answer, 1 is accepted

Sort by
0
Aleksandar
Telerik team
answered on 19 May 2021, 11:55 AM

Hi Vincent,

There was a known issue concerning the foreign key TagHelper that has been fixed with the latest release:

https://github.com/telerik/kendo-ui-core/issues/6283

I suggest updating to the latest version of Telerik UI for ASP.NET Core in order to benefit from the fix.

Regards,
Aleksandar
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Tags
Grid
Asked by
Vincent
Top achievements
Rank 1
Answers by
Aleksandar
Telerik team
Share this question
or