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

Retrieving additional values in ClientGroupHeaderTemplate

1 Answer 306 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Iain asked on 25 Mar 2015, 10:20 AM

I have a grid that I'm grouping by the Value of a KeyValuePair property in my Model. I'm able to access the GroupedBy value (using "#= value#") in the ClientGroupHeaderTemplate, but I also need access to the Key (represented in the code below as "#= key#". Is it possible to do this?

.HtmlAttributes(new { @class = "kendo-grid", data_get_url = Url.Action("GetStaticPermissions", "PermissionSetRecord", new { permissionSetId = Model.PermissionSetId }) }) 
.DataSource(dataSource => dataSource
        .Read(read => read.Action(Model.ReadAction, "PermissionSetRecord", new { category = Model.Category, permissionSetId = Model.PermissionSetId }))
        .Group(groups => groups.Add(permission => permission.PermissionGroupInfo.Value)))
    .Columns(columns =>
        columns.Bound(d => d.PermissionGroupInfo.Value)
        columns.Bound(d => d.DisplayName)
            .ClientTemplate(Html.Partial("Permissions/_Toggle", Model).ToHtmlString());

@helper GetTemplateTitle()
          #= value# 
// I want access to the key of my property here
          #= key#


1 Answer, 1 is accepted

Sort by
Petur Subev
Telerik team
answered on 27 Mar 2015, 08:57 AM
Hello Iain,

I posted a reply in the other thread that you opened on the same subject, for reference I will paste the reply here:


The only item that I assume you are searching for is called "field". Try to use 

#= field # inside your template and see if it suits your needs.

I hope this helps.

Kind Regards,
Petur Subev

See What's Next in App Development. Register for TelerikNEXT.

Asked by
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question