【问题标题】:Telerik grid custom field not workingTelerik 网格自定义字段不起作用
【发布时间】:2016-02-25 13:53:28
【问题描述】:

我正在尝试用项目的 Content/images 文件夹中的图像填充网格的一列,但由于某种原因,该列不显示任何内容。

由于我可能以错误的方式编写了路径,因此我尝试使用仅包含一些文本的网络示例,但没有任何运气。

这是我的自定义列:

columns.Template(@<text>
   custom content here, which is not related to the data
   </text>).Title("Column Title");

我正在使用 Ajax 绑定,因此无法选择 columns.ClienteTemplate(我需要使用聚合,这在服务器绑定时是不可能的。

这是我的数据源(略):

.DataSource(dataSource => dataSource
          .Ajax()
          .Read(read => read.Action("Products_Read", "Home"))
          )

任何帮助将不胜感激。

【问题讨论】:

    标签: asp.net-mvc razor telerik


    【解决方案1】:

    对于任何想知道它是如何完成的人,这里是答案:

        columns.Template(@<text>custom content</text>)
          .ClientTemplate("<img src=" + "../Images/LogoSGM-small.png" + " />")
          .Title("IMG");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-06-17
      • 2011-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多