Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 3 向Telerik MVC网格发送附加数据_Asp.net Mvc 3_Telerik Grid_Telerik Mvc - Fatal编程技术网

Asp.net mvc 3 向Telerik MVC网格发送附加数据

Asp.net mvc 3 向Telerik MVC网格发送附加数据,asp.net-mvc-3,telerik-grid,telerik-mvc,Asp.net Mvc 3,Telerik Grid,Telerik Mvc,我正在使用AJAX绑定的Telerik MVC网格。我使用如下代码为网格发送数据: return View(new GridModel(...)); 我希望能够以相同的操作方法向客户端发送附加数据。例如,我需要发送一个int值Total,它将显示在网格上方(该值必须从db中获取,不能在客户端进行计算) 请分享您的想法。为了获得您想要的结果,您可以添加一个客户端页脚模板,该模板绑定到从模型传递下来的属性,如下所示: columns.Bound(o => o.UnitPrice)

我正在使用AJAX绑定的Telerik MVC网格。我使用如下代码为网格发送数据:

return View(new GridModel(...));
我希望能够以相同的操作方法向客户端发送附加数据。例如,我需要发送一个int值Total,它将显示在网格上方(该值必须从db中获取,不能在客户端进行计算)


请分享您的想法。

为了获得您想要的结果,您可以添加一个客户端页脚模板,该模板绑定到从模型传递下来的属性,如下所示:

columns.Bound(o => o.UnitPrice)
       .ClientFooterTemplate("<#= Total #>");
columns.Bound(o=>o.UnitPrice)
.ClientFooterTemplate(“”);

如果您想在将来使用聚合函数解决这些问题,Telerik网站上还有一个很好的例子详细说明了。谢谢您的回复,但这并不是我所需要的,我已经解决了这个问题,请看答案。我在下面的Telerik论坛帖子中找到了答案。你能发布你问题的解决方案吗?你发布的链接已经不存在了