Kendo MVC grid filter, replace with label

24 Views Asked by At

I am trying to replace the filter drop down on the Kendo grid with a message instructing the user to use the custom filter that exists external to the grid. Please note, this is only for one of the filter columns, all the others are fine. I would like it look something like this:

enter image description here

I tried adding the text into the Filterable UI property but that is expecting a JavaScript function and so throws an error in the browser.

enter image description here

1

There are 1 best solutions below

0
Martin D. On

It's a bit of a hack, but you could call a javascript function that replaces the content of the drop down like this :

c.Bound(m => m.SendToLabAtFilter)
.Title("Sent to Lab At")
.HtmlAttributes(KendoGridConstants.NoWrapStyle)
.Format(KendoGridConstants.DateTimeColumnFormat)
.Width(KendoGridConstants.DateTimeColumnWidth)
.Filterable(f => f.UI("sendToLabAtFilter"));

<script type="text/javascript">
    function sendToLabAtFilter(e) {
        $(e).parent().html("Please use filter on the left hand side of the screen.");
    }
</script>