update grid from EditorTemplate hyperlink value

2 posts, 0 answers
  1. Tam
    Tam avatar
    3 posts
    Member since:
    Feb 2015

    Posted 23 Nov 2015 Link to this post

    When the user clicks Update the cell in the grid isn't being populated with the EditorTemplate hyperlink value.

    EditorTemplate:
    @(Html.Kendo().Editor()
    .Name("EVIDENCE")
    .HtmlAttributes(new { style = "width: 250px;height:25px" })
    .Tools(tools => tools.Clear().CreateLink())
    .Value(@<text> </text>)
    )

    view:
    <div class="wide-grid">
    @Html.AntiForgeryToken()
    @(Html.Kendo().Grid(Model.TASKs)
    .Name("TasksGrid")
    .Columns(columns =>
    {
    columns.Command(command => { command.Edit(); }).Width(50);
    columns.Bound(c => c.STATUS).Visible(false);
    columns.ForeignKey(c => c.RESP_ORG_ID, (System.Collections.IEnumerable)ViewData["RespOrgs"], dataFieldText: "RESP_ORG_DESC", dataFieldValue: "RESP_ORG_ID").Title("Resp Org").Width("200px");
    columns.ForeignKey(c => c.ACTIVITY_ID, (System.Collections.IEnumerable)ViewData["Activities"], dataFieldText: "ACTIVITY_DESC", dataFieldValue: "ACTIVITY_ID").Title("Activity");
    columns.ForeignKey(c => c.SOURCE_DOC_ID, (System.Collections.IEnumerable)ViewData["SourceDocs"], dataFieldText: "SOURCE_DOC_DESC", dataFieldValue: "SOURCE_DOC_ID").Title("Source Doc").ClientTemplate("<a href='#=SOURCE_DOC_PATH#'>#=SOURCE_DOC_DESC#</a>").Width(125);
    columns.ForeignKey(c => c.ROLE_ID, (System.Collections.IEnumerable)ViewData["Roles"], dataFieldText: "ROLE_DESC", dataFieldValue: "ROLE_ID").Title("Role");
    columns.Bound(c => c.RESP_ORG_ID).Visible(false);
    columns.Bound(c => c.ACTIVITY_ID).Visible(false);
    columns.Bound(c => c.ROLE_ID).Visible(false);
    columns.Bound(c => c.DOC_REF).Width(75);
    columns.Bound(c => c.DUE_DATE).EditorTemplateName("DueDate").Width(75);
    columns.Bound(c => c.COMPLETED).Width(75);
    columns.Bound(c => c.TASK_DESC).EditorTemplateName("TaskDescription").Width(500);
    columns.Bound(c => c.EVIDENCE).EditorTemplateName("TaskEvidence").Width(15);
    columns.Bound(c => c.CTL_NO);
    columns.Bound(c => c.ACQUISITION_ID).Visible(false);
    })
    .ToolBar(toolbar => toolbar.Create().Text("Add New Task"))
    .Editable(editable => editable.Mode(GridEditMode.InLine))
    .Pageable()
    .Sortable()
    .Filterable()
    .Groupable()
    .DataSource(dataSource => dataSource
    .Ajax()
    .PageSize(15)
    .ServerOperation(false)
    .Events(events => events.RequestEnd("requestEnd"))
    .Model(model =>
    {
    model.Id(a => a.TASK_ID);
    })
    .Update(update => update.Action("Edit", "Task").Data("sendAntiForgery"))
    .Read(read => read.Action("TaskGrid_Read", "Task", new { id = @Model.ACQUISITION_ID }))
    .Create(create => create.Action("Create", "Task").Data("sendAntiForgery"))
    )
    )
    </div>

  2. Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2159 posts

    Posted 25 Nov 2015 Link to this post

    Hello Tam,

    I covered the question in the support thread on the same topic. Let's continue the discussion there.

    Regards,
    Dimiter Madjarov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top