Hello,
I need some help to complete below functionality.
I am trying to bind/create a template column, so when the grid loads it can call an html helper or controller action to get the value/text for that column. Which means, i am trying to bind a non modal or datasource property to one of the grid columns.
Goal: Bind one of the columns in kendo grid with external text.
My grid looks something like this,
@(Html.Kendo().Grid<Model>()
.Name("Grid")
.AutoBind(false)
.Columns(columns =>
{
columns.Bound(row => row.Id).Hidden(true);
columns.Bound(row => row.Name);
columns.Template(@<text>@Html.GetSomeText("SomeContext")</text>).Title("title");
columns.Template(@<text>@Html.Action("GetSomeText", "controller", new {ctx = SomeContext})</text>);
}
As you can see above, I tried couple of ways to get the text for the column - Html helper and Action Method, but in both the cases, server side code is not even being triggerd and column remains empty in the grid.
Any help is much appreciated.
Thanks,
Balwant
I need some help to complete below functionality.
I am trying to bind/create a template column, so when the grid loads it can call an html helper or controller action to get the value/text for that column. Which means, i am trying to bind a non modal or datasource property to one of the grid columns.
Goal: Bind one of the columns in kendo grid with external text.
My grid looks something like this,
@(Html.Kendo().Grid<Model>()
.Name("Grid")
.AutoBind(false)
.Columns(columns =>
{
columns.Bound(row => row.Id).Hidden(true);
columns.Bound(row => row.Name);
columns.Template(@<text>@Html.GetSomeText("SomeContext")</text>).Title("title");
columns.Template(@<text>@Html.Action("GetSomeText", "controller", new {ctx = SomeContext})</text>);
}
As you can see above, I tried couple of ways to get the text for the column - Html helper and Action Method, but in both the cases, server side code is not even being triggerd and column remains empty in the grid.
Any help is much appreciated.
Thanks,
Balwant