【问题标题】:Syncfusion mvc grid control filtering on hyperlink columnSyncfusion mvc网格控制过滤超链接列
【发布时间】:2018-11-26 19:33:55
【问题描述】:

我刚刚尝试了 mvc 的同步融合控制,但遇到了一些障碍。我的问题是,当我使用列模板功能在 ej 网格列中使用超链接时,过滤器不适用于该列。我当前的 UI 是这样设计的,即我需要将列值呈现为可点击的链接,并且我还需要允许基于该列中的值进行过滤。

【问题讨论】:

    标签: syncfusion


    【解决方案1】:

    要执行过滤、排序、分组等操作,字段必须启用到列。将根据上述列值执行操作。要在模板列中执行过滤,请将 Field 属性定义为模板列。

    参考以下代码示例

    @(Html.EJ().Grid<EmployeeView>("ColumnTemplate")
        .Datasource((IEnumerable<object>)ViewBag.datasource)
        .AllowPaging()
        .ToolbarSettings(toolBar => toolBar.ShowToolbar().ToolbarItems(items =>
         {
           items.AddTool(ToolBarItems.ExcelExport);
           items.AddTool(ToolBarItems.WordExport);
           items.AddTool(ToolBarItems.PdfExport);
         }))       
        .Columns(col =>
        {
            col.HeaderText("First Name").Field(“FirstName”).Template("#columnTemplate").TextAlign(TextAlign.Center).Width(80).Add();
            col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(100).Add();
            col.Field("LastName").HeaderText("Last Name").Width(100).Add();
            col.Field("BirthDate").HeaderText("Birth Date").TextAlign(TextAlign.Right).Width(100).Format("{0:MM/dd/yyyy}").Add();
            col.Field("Country").Width(100).HeaderText("Country").Add();
        })
    )
    

    如果您有其他疑问,请与我们联系。

    【讨论】:

    • 干杯兄弟。非常感谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多