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

Custom commands at a group level

1 Answer 135 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Alex asked on 21 Mar 2014, 02:03 PM

I've just purchased the ASP.Net MVC Kendo UI Grid and I am looking to do the following:-

I have a dataset which in the redacted code below is grouped by RegionalManager like this:-

    .DataSource(dataSource => dataSource
            .Group(grp => grp.Add(m => m.RegionalManager ))
            .Batch(true) // enable batch updates

What I would like to be able to do is somehow add a command at the group level so I could swap the regional manager for an entire grouping.
At the moment, I am only able to add custom commands at the whole grid or row level.

Any help would be much appreciated.

1 Answer, 1 is accepted

Sort by
Alexander Popov
Telerik team
answered on 25 Mar 2014, 10:28 AM
Hello Alex, 

Although adding a command button on a group level is currently not supported out of the box, it could be achieved using a custom solution. For example:
  1. Use a ClientGroupHeaderTemplate that displays a button that has a certain class: 
    columns.Bound(p => p.RegionalManager ).ClientGroupHeaderTemplate("Regional Manager : #=value# <a href='\\#' groupID='#=value#' class='k-button group-edit '>Click me</a> ");
  2. Attach a click event handler to this class: 
        $("body").on("click", ".group-edit", function (e) {

Alexander Popov

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

Asked by
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question