网格列中需要电子邮件列
我正在使用 telerik mvc 网格并通过数据表绑定我的列,我有一个“电子邮件”列,我需要以这种方式格式化该列,以便用户可以通过单击电子邮件来发送邮件..
我'我使用“MailTo”扩展来格式化列,但这对我来说不起作用......
任何想法都可以通过这种/其他方式实现相同的目标
@inherits System.Web.Mvc.WebViewPage<System.Data.DataTable>
@BHN.PayGo.ASP.Web.Utilities.Extensions
@if (Model != null)
{
@(Html.Telerik().Grid<System.Data.DataRow>(Model.Rows.Cast<System.Data.DataRow>()).Name("grdHierarchy")
.Columns(columns =>
{
foreach (System.Data.DataColumn column in Model.Columns)
{
if (column.ColumnName == "Email")
{
columns.Bound(column.DataType, column.ColumnName).Title("Email").Format(Html.Mailto("{0}", "{0}")).Encoded(false);
}
}
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_HierarchyBinding", "Reports"))
.Pageable(settings => settings.Total((int)ViewData["TOTAL_ACCOUNTHIERARCHY_DATA"]))
.EnableCustomBinding(true)
.Sortable(settings => settings.Enabled(false))
.Scrollable(settings => settings.Enabled(true).Height("auto"))
)
}
uuired
I'm using telerik mvc grid and bound my columns throuugh Data Table, I having a column "Email", where I need to format this column in such a way, so that user can do the mail by clicking on email..
I'm using a "MailTo" extension to format the column, but it's not work for me...
Any idea to do achieve the same by this/other way
@inherits System.Web.Mvc.WebViewPage<System.Data.DataTable>
@BHN.PayGo.ASP.Web.Utilities.Extensions
@if (Model != null)
{
@(Html.Telerik().Grid<System.Data.DataRow>(Model.Rows.Cast<System.Data.DataRow>()).Name("grdHierarchy")
.Columns(columns =>
{
foreach (System.Data.DataColumn column in Model.Columns)
{
if (column.ColumnName == "Email")
{
columns.Bound(column.DataType, column.ColumnName).Title("Email").Format(Html.Mailto("{0}", "{0}")).Encoded(false);
}
}
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("_HierarchyBinding", "Reports"))
.Pageable(settings => settings.Total((int)ViewData["TOTAL_ACCOUNTHIERARCHY_DATA"]))
.EnableCustomBinding(true)
.Sortable(settings => settings.Enabled(false))
.Scrollable(settings => settings.Enabled(true).Height("auto"))
)
}
uuired
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 Ajax 数据绑定时,您将需要使用客户端模板(而不是您使用过的服务器端模板):请参阅 http://demos.telerik.com/aspnet-mvc/grid/templatesclientside
When using Ajax Databinding you will need to use client templates (rather than the server side templates you have used): see http://demos.telerik.com/aspnet-mvc/grid/templatesclientside