1

I have some radio buttons on my page and I want to bind one of my Kendo Grid's columns according to the user's selection, and then refresh the grid.

This is my javascript code:

function change(c) {
    var grid = $("#grid").data('kendoGrid');
    switch (c) {
        case 2:
            break;
        case 3:
            break;
        default:
        case 1:
            break;
    }
}
Nic
  • 12,220
  • 20
  • 77
  • 105
Akbari
  • 2,369
  • 7
  • 45
  • 85

1 Answers1

1

You can use javascript to show/hide the right columns. See the API definition.

function change(c) {
    var grid = $("#grid").data('kendoGrid');
    switch (c) {
        case 2:
            grid.hideColumn("Column1");
            grid.showColumn("Column2");
            break;
        case 3:
            grid.showColumn("Column3");
            break;
        default:
        case 1:
            grid.hideColumn(3);
            grid.showColumn(4);
            break;
    }
}

A while ago I posted an answer here, explaining different ways to hide columns.

Community
  • 1
  • 1
Nic
  • 12,220
  • 20
  • 77
  • 105