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

kendo ui grid with no model

3 Answers 479 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 19 Sep 2014, 03:55 PM
Hi I want to create a grid using the server wrapper without having to specify a certain model, I just want a column to put string values and a custom column to delete the values.

so with javascript I can do that this way:

​ $("#gridtest").kendoGrid({
height: 150,
columns: [
{
attributes: {"style":"padding-left:0px"},
field: "date",
title: "Selected Dates",
},
//{ command: [{ className:"select", name: "destroy", text: "" }], title: " ", width: 40 }
{ command: [{ id: "destroy", name: "destroy", template: "<img class='select' src='@Url.Content("~/Contents/Images/delete.png")' onclick='deleteGridRow(this)'/>" }], title: " ", width: 40 }
],
editable: "inline"
});


3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 23 Sep 2014, 12:00 PM
Hello Jim,

MVC wrapper always requires model. It could be explicitly set Grid<Some Model> /as in the remote binding example/ or inferred implicitly Grid(Model) /as in the local binding example/.

You can also create dummy view model with `field: "date",` property so that the grid binds properly.

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Stefano
Top achievements
Rank 1
answered on 02 Jun 2016, 07:56 AM
I've same problem. I have not a predefinite model, my model is dynamic. For example suppose to create a grid where columns are variable from a sql query where columns select can change. How can I do that ?
0
Dimiter Madjarov
Telerik team
answered on 03 Jun 2016, 09:44 AM

Hello Stefano,

I would recommend to check the following example project, which demonstrates a possible approach to achieve the task.

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Jim
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Stefano
Top achievements
Rank 1
Dimiter Madjarov
Telerik team
Share this question
or