I had your problem yesterday and I found this link. The below script must insert into T4 template file.
<script>
$(document).ready(function () {
setTimeout(function () {
$("#MYGRID").kendoGrid({
dataSource: {
type: "json",
transport: {
read: "/GetJsonData"
},
schema: {
model: {
fields: {
item1:{type:"string"},
item2:{type:"string"},
item3:{type:"string"}
}
}
},
pageSize: 10
},
columns: [{
field:"Id",
filterable: false
},
"Column2",
"Column3"
]
});
});
});
</script>
Update: I customize the MVC grid in T4 template for Kendo grid:
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
<# IEnumerable < PropertyMetadata > properties = ModelMetadata.Properties;
foreach (PropertyMetadata property in properties)
{
if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey)
{
#>
<#
// We do not want to show any association properties for which there is
// no associated foreign key.
if (property.IsAssociation && GetRelatedModelMetadata(property) == null)
{
continue;
}
#>
columns.Bound(model => model.<#= GetValueExpression(property) #>);
<#}
}#>
.columns.Bound(item =>
@item.objectId).Title("title").Filterable(false).Groupable(false);
})
.DataSource(dataSource => dataSource
.Server
.Model(model => model.Id(item => item.objectId))
)
)