How to set custom control in the kendo grid filter row?

Forums C#How to set custom control in the kendo grid filter row?
Staff asked 2 years ago

I have a date column in my grid and I want to set a custom date range filter for that column.

Answers (1)

Add Answer
Chand Dakhara Marked As Accepted
Staff answered 1 month ago

Hello, @Raj Dev

You can call a custom function for the template property of the filterable cell. Just like the below.

filterable: {
  cell: { template: customFilter },
  showOperators: false
}

function customFilter(args) {
    var filterCell = args.element.parents(".k-filtercell");
    filterCell.empty();
    filterCell.html('<input type="text" name="datefilter" class="k-textbox k-FullWidth" value="" autocomplete="off" readonly/>');

    $('input[name="datefilter"]').daterangepicker({
        autoUpdateInput: false,
        showDropdowns: true,
        locale: {
            cancelLabel: 'Clear'
        }
    });
}

 

Subscribe

Select Categories