MvcContrib Grid 仅用于编辑某些列

发布于 2024-11-16 13:37:06 字数 553 浏览 7 评论 0原文

我有一个观点:

<% Html.Grid(Model.InnerModel.OrderRecords)
    .Empty("No data available")
    .Attributes(new Hash(id => "RoadReportResultsTable"))
    .Columns(column =>
    {
        column.For(x => x.OrderNumber);
        column.For(x => x.DateReceived);
        column.For(x => x.TotalCount);
        column.For(x => x.DateSent);
        column.For(x => x.SentCount);
        column.For(x => x.Comments);
    }).Render();
%>

我需要仅使“评论”列可编辑,因此用户只能输入“评论”,但无法编辑任何其他列。

我想打开评论点击弹出窗口

I Have a view:

<% Html.Grid(Model.InnerModel.OrderRecords)
    .Empty("No data available")
    .Attributes(new Hash(id => "RoadReportResultsTable"))
    .Columns(column =>
    {
        column.For(x => x.OrderNumber);
        column.For(x => x.DateReceived);
        column.For(x => x.TotalCount);
        column.For(x => x.DateSent);
        column.For(x => x.SentCount);
        column.For(x => x.Comments);
    }).Render();
%>

I need to make only the Comments column editable, so the user can only enter the Comments, but can't edit any of the other columns.

I want to open a popup on Comments Click

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉鱼一梦 2024-11-23 13:37:06

在我的项目中,我使用此代码将操作链接添加到列:

column.For(group => Html.ActionLink("Delete", "Delete", new { appId = Model.ApplicationId, id = group.Id }, null))
        .Encode(false)
        .Sortable(false);

On my project I use this code to add action link to column:

column.For(group => Html.ActionLink("Delete", "Delete", new { appId = Model.ApplicationId, id = group.Id }, null))
        .Encode(false)
        .Sortable(false);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文