Kendo Telerik TagHelper

问题描述 投票:0回答:1

我在ASP核心中使用kendo Telerik,并与HTML Helper一起使用。但是现在我要使用标签助手。谁知道用TagHelpers替换我的代码:

HTML帮助器:

    @model IEnumerable<Lms.Domain.Models.Group>

    @(Html.Kendo().Grid(Model)
    .Name("grid")
    .Columns(columns =>
    {
        columns.Bound(c => c.Id);
        columns.Bound(c => c.GroupName);
        columns.Bound(c => c.LibraryId);
        columns.Command(command => { command.Edit(); command.Destroy()});
    })
    .Pageable()
    .Sortable()
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(5)
    .ServerOperation(false)
    .Model(M=>M.Id(c=>c.Id))
    .Read(read=>read.Action("GroupView","Group"))
   )
);

实际上在使用标签助手进行数据绑定时有问题吗?

kendo-ui telerik kendo-grid telerik-grid
1个回答
0
投票

请参见下面的代码

        <kendo-grid name="grdName" height="550">
                    <columns>
                        <column field="Id" hidden="true"/>
                        <column field="GroupName" title="Group Name" />
                        <column field="LibraryId" title="Library Id" />
                        <column width="100" title="View/Edit">
                            <commands>
                                <column-command name="custom" text="<span 
  class='fa-1x fa fa-edit' style='color:blue'>
  </span>" click="view"></column-command>
                            </commands>
                        </column>
                    </columns>
                    <toolbar>
                        <toolbar-button name="custom" template="addNewTemplate"> 
                        </toolbar-button>
                    </toolbar>
                    <scrollable enabled="true" />
                    <sortable enabled="true" />
                    <pageable enabled="true" />
                    <filterable enabled="true" />
                    <datasource type="DataSourceTagHelperType.Ajax">
                        <transport>
                     <read url="@Url.Action("GetList", Controller)"/>
                        </transport>
                    </datasource>
                </kendo-grid>
    
© www.soinside.com 2019 - 2024. All rights reserved.