Oxon
Oxon

Reputation: 5041

Telerik Kendo UI Grid: Allow grouping of any one column at a time

Question is specific to MVC grid control. How to restrict grouping of two or more columns in Kendo Grid? User should be able to drag and group any column but not more than one column.

Upvotes: 0

Views: 921

Answers (1)

Jarosław Kończak
Jarosław Kończak

Reputation: 3407

Bind this function to dataBound grid event:

function onDataBound(e) {
    var gr = e.sender.dataSource.group();
    if(gr.length > 1){
        gr.shift();
        e.sender.dataSource.fetch();
    }
}

Greetings.

Upvotes: 1

Related Questions