0

I have a Kendo grid which displays some data. Now I want to add an image-column.

I tried it like this :

@(Html.Kendo().Grid<TegelCheckerModel>()
            .Name("Grid")
            .Columns(columns =>
            {
                columns.Bound(p => p.IsTegelZichtbaar).ClientTemplate("#= getImage(data)#");
            })
            .AutoBind(true)
            .Pageable()
            .Sortable()
            .Filterable()
            .DataSource(dataSource => dataSource
            .Ajax() //Or .Server()
            .Read(read => read.Action("GetTegels", "TegelChecker")
            .Data("getAlvNummerAndVoorWie"))
            )
        )

and then in js I do the following :

function getImage(data) {
            var html;

            if (data.IsTegelZichtbaar) {
                html = "<img src='~/Images/valid.jpg' />";
            }
            else{
                html = "<img src='~/Images/notvalid.jpg' />";
            }
            return html;
        }

The images exist but they are not displayed. What am I missing? What am I not seeing?

Bart Schelkens
  • 1,235
  • 4
  • 21
  • 45

1 Answers1

1

There was a problem with uploading the image. SO that is why it was not displaying. Stupid me for not checking that.

Bart Schelkens
  • 1,235
  • 4
  • 21
  • 45