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

Change Column Filter options to match overridden values?

1 Answer 253 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 21 Jan 2020, 05:16 PM

I have a GridBoundColumn in my RadGrid that displays a true or false value. In the database, this is stored as a 1 or a 0. During the ItemDataBound event, I check the incoming value for this column and override it to either be the string "TRUE" or the string "FALSE". However, the RadGrid is still identifying the column's datatype as an integer so the filter menu doesn't have certain filtering options like "Contains". I tried to manually set the DataType to "System.String" on both the column itself and during the ItemDataBound event and, while this provides me the filter menu I want, the functions inside don't work (clicking "contains", for example, does nothing at all). 

 

Is there anyway for me to force the filter options to match the values after DataBound?

 

Thanks!

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Jan 2020, 05:01 PM

Hi Chris,

 

You can achieve this requirement by manually changing the filter value during the ItemCommand event handler:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/how-to/Filtering/operate-with-the-filterexpression-manually

The property is called column.CurrentFilterValue.

Feel free to give it a try and let me know how it goes.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or