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

[Solved] Impossible to render Column Template

0 Answers 25 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.
keitboor douze
Top achievements
Rank 1
keitboor douze asked on 02 Jan 2012, 10:17 AM
Hello,

I have a problem to render column template with Telerik Grid for MVC. I'm currently using the last version : 2011.3.1115.340 with ASP.NET MVC 3 (Razor view engine)

This the code of my view page :

@{
    Html.Telerik().Grid<CustomerModel>()
        .Name("CustomersGrid")
        .DataKeys(keys =>
                      {
                          keys.Add(c => c.Id);
                      })
        .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Text).ImageHtmlAttributes(new {style = "margin-left:0"}))
        .DataBinding(dataBinding =>
                         {
                             dataBinding.Ajax()
                                 .Select("_SelectBinding", "Customers")
                                 .Insert("_InsertBinding", "Customers")
                                 .Update("_SaveBinding", "Customers")
                                 .Delete("_DeleteBinding", "Customers");
                         })
        .Columns(columns =>
                     {
                         columns.Bound(c => c.Id).Width(20).ReadOnly(true);
                         columns.Bound(c => c.Email);
                         columns.Bound(c => c.Lastname);
                         columns.Bound(c => c.Firstname);
                         columns.Bound(c => c.MobilePhone);
                         columns.Bound(c => c.EnterpriseName);
                         columns.Bound(c => c.ManagementComments);
                         columns.Bound(c => c.IsActivated);
                         columns.Template(
                             @<text>
                                  <div>@item.Id</div>
                              </text>
                             ).Title("Premium");
                     })
        .Editable(editing => editing.Mode(GridEditMode.InLine))
        .Pageable()
        .Sortable()
        .ClientEvents(events => events.OnComplete("Grid_onComplete")).Render();
}

I have the template column "premium" in my grid but it's still empty :

http://www.imagup.com/data/1140161102.html 

I also test without the Render(), same result :

@(Html.Telerik().Grid<CustomerModel>()
        ... blabla ...

                         columns.Template(
                             @<text>
                                  <div>@item.Id</div>
                              </text>
                             ).Title("Premium");
                     })
        .Editable(editing => editing.Mode(GridEditMode.InLine))
        .Pageable()
        .Sortable()
        .ClientEvents(events => events.OnComplete("Grid_onComplete"))
)



Thanks for your help !
Tags
Grid
Asked by
keitboor douze
Top achievements
Rank 1
Share this question
or