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

Custom Filter Template for Enum Field

1 Answer 199 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Neilton asked on 21 Jan 2015, 05:25 PM

Im using a viewmodel that has an enumeration named "status".
The Grid auto-generates a filter from the enum, which is cool. But I'd like to do 2 things in the grid:
1: Change the enum text
2: Hide some enum options.

I attached a print of the filter with all enum options.

This is my grid:
    .Name("grid" + gridName)
    .ToolBar(comands => comands.Template(templateHeader))
    .Columns(columns =>
        columns.Bound(c =>"Name");
        columns.Bound(c => c.status).Title("Status");
    .ColumnMenu(c => c.Messages(m => m.SortAscending("Ordem Ascendente").SortDescending("Ordem Descendente").Columns("Colunas")))
        //.Pageable(pageable => pageable.Input(true).Numeric(false))
    .Resizable(resizable => resizable.Columns(true))
    .DataSource(dataSource => dataSource.Ajax().Read(read => read.Action(action, controller).Data("filtroAdicionalCargasPendentes")))


1 Answer, 1 is accepted

Sort by
Alexander Popov
Telerik team
answered on 23 Jan 2015, 01:47 PM
Hi Joeldo,

This behavior is not supported out of the box, however you can achieve similar results by subscribing to the Grid's filterMenuInit event. Once the event is triggered you can modify the DropDownList's data as necessary.

Alexander Popov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Asked by
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question