This is a migrated thread and some comments may be shown as answers.

[Solved] Razor Grid using Partial View in ClientTemplate

0 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gmuir
Top achievements
Rank 1
gmuir asked on 06 Dec 2011, 06:32 PM
I am trying to use the "Details" Partial View in the ClientTemplate, but I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type".
It worked before with Server Template, but then I tried to use ajax edit popup, so I have to change it to use  ".DetailView(view => view.ClientTemplate" instead of ".DetailView(view => view.Template"

@(Html.Telerik().Grid(Model)
    .Name("History")
    .DataKeys(keys => { keys.Add(p => p.HistoryID); })
    .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image).ImageHtmlAttributes(new { style = "margin-left:0" }))
    .DataBinding(dataBinding => {
        dataBinding.Ajax()
            .Update("Edit", "History")
            .Insert("Create", "History");
    })   
    .Columns(columns =>
    {
        columns.Bound(d => d.ScanNum).Width(57).Title("Scan");
        columns.Bound(d => d.PatientID).Width(73).Title("Patient ID");
        columns.Bound(d => d.SiteNum).Width(50).Title("Site");
        columns.Bound(d => d.Visit).Width(51);
        columns.Command(commands => { commands.Edit().ButtonType(GridButtonType.Image); }).Width(180).Title("Commands");
    })
    .DetailView(view => view.ClientTemplate(@<text>@Html.Partial("Details",@item)</text>))
    .Editable(editing => editing.Mode(GridEditMode.PopUp))
    .Pageable(paging => paging.PageSize(5))
    .Scrollable(scrolling => scrolling.Height(580))
    .Sortable())
Tags
Grid
Asked by
gmuir
Top achievements
Rank 1
Share this question
or