Retrieving additional values in ClientGroupHeaderTemplate

2 posts, 0 answers
  1. Iain
    Iain avatar
    1 posts
    Member since:
    Sep 2012

    Posted 25 Mar 2015 Link to this post


    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#


  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 27 Mar 2015 Link to this post

    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.

Back to Top