I'm trying to enable grouping by a foreign key column. However, a default Ajax setup will display the id of the column, not the display text for the group header. With server binding, the group header displays as expected. With Ajax binding however, it won't.
Using Kendo 2012.2.607. I know this used to work with Telerik, used it all the time.
@(Html.Kendo().Grid(Model.Users)
.Name(
"Users"
)
.DataSource(c => c.Ajax()
.Read(
"_Roles"
,
"Users"
)
.Group(g => g.Add(o => o.RoleId)))
.Columns(c => {
c.Bound(o => o.UserName);
c.ForeignKey(o => o.RoleId, Model.Roles);
c.Bound(o => o.IsActive);
})
.Sortable()
.Filterable()
.Groupable()
.Pageable())
With this, the group headers will read as "Role: 1", "Role: 2" and so on. Expected "Role: Admin", "Role: User", etc. Can't really find any options to fix this. Trying to add a ClientGroupHeaderTemplate doesn't work either - always yields an error about whatever value being undefined. The anonymous function called to display the template has no real data to display the correct label.
c.ForeignKey(o => o.RoleId, Model.Roles)
.ClientGroupHeaderTemplate(
"#= Title #"
);
Edit - I setup a jsfiddle here to illustrate.