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

import IMG from DB to a Grid

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Svetoslav
Top achievements
Rank 1
Svetoslav asked on 12 Feb 2013, 04:21 PM
HI im using ASP.NET MVC and i generated a Grid by the following code the problem is that the images are not working infact the .ClientTemplate() isnt working at all is there something that im missing do i need to do something in my model ?

@(Html.Kendo().Grid(Model).Name("TeachersGrid")
    .Columns(columns =>
    {
        columns.Bound(m => m.Title).Title("    ");
        columns.Bound(m => m.First_name).Title("Име")
        columns.Bound(m => m.Second_name).Title("Презиме");
        columns.Bound(m => m.Family_name).Title("Фамилия");
       columns.Bound(m => m.img).ClientTemplate("<img src='#=img#' />");
    })
    .Groupable()
    .Sortable()
    .Scrollable()
    .Filterable()
    .Reorderable(reorder => reorder.Columns(true))
    .Resizable(resize => resize.Columns(true))
)


1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Feb 2013, 01:55 PM
Hello Svetoslav,

In server binding mode you should use the Template method instead. The ClientTemplate should be used only for Ajax binding. Please check this documentation topic for a sample in both scenarios.

Kind regards,
Daniel
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Svetoslav
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or