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

Change the Filter in Kendo.Grid to Use Text instead of Bound Value associated w/Column

2 Answers 979 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aaron
Top achievements
Rank 1
Aaron asked on 07 Jul 2015, 06:38 PM

In my Kendo.Grid I have:

columns.Bound(c => c.FORMRIGHTTYPEID).Width("25").Title("Form Right").HtmlAttributes(new { @class = "text-align: center;" })
  .Template(@<text>
    @if (item.FORMRIGHTTYPEID != null)
    {
      @DisplayRight((long)item.FORMRIGHTTYPEID)
    }
    </text>);

Note that I am displaying a text value associated w/the FORMRIGHTTYPEID numeric value.  I have made the grid "Filterable":

@(Html.Kendo().Grid<EPIMS.Models.FORMRIGHTS>()

...

...

.Scrollable()
.Groupable()
.Sortable()
.Filterable(filterable => filterable
                .Extra(false)
                .Operators(operators => operators
                .ForString(str => str.Clear()
                .Contains("Contains")
)))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.BindTo(Model)

)

 

My problem is that the Filter option shows "Show items with value that: Is equal to" but does not allow me to enter text.  Rather (and as expected), the value MUST BE numeric as the column is bound to a numeric value field.

Is it possible to customize the Filter?

 Thanks

2 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 09 Jul 2015, 08:33 AM

Hello Aaron,

 

In order to customize the filter please use the columns.filterable.ui. Also please review the Grid / Filter menu customization for a live demo that uses this approach. 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Aaron
Top achievements
Rank 1
answered on 06 Nov 2015, 10:58 PM
I found that adding the Description to my Model and binding that ​value to the Grid column was the easiest way to do.  Thanks.
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or