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

Formatting Filter List

1 Answer 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joshua
Top achievements
Rank 1
Joshua asked on 23 May 2011, 09:28 PM
I have a GridViewComboBoxColumn that has something like the following

Value    Text
1            Item 1
2            Item 2
3            Item 3
4            Item 4

In the Grid view/edit templates it shows "Item 1", "Item 2", etc with the values storing correctly in the database.  However, for the filter it shows "1", "2", "3", "4", etc.

1) How do I get the filter to show the Text and not the Values??

2) I'm adding a ColumnFilterDescriptor for that column. Currently, I'm doing something like:
columnDescriptor.DistinctFilter.DistinctValues.Add(1);
Is there anything I need to do differently (once I implement what you suggest for question 1) in order to set the default filter?  Will I still use the Value, or will I begin using the Text?

Thanks,
Joshua

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 May 2011, 11:55 AM
Hello Joshua,

In order to show the Text of the CheckBox object instead if the Value in the filtering window,  you should create a custom filtering. Regarding your questions:
 
1. You may find out how to do this custom filtering for GridViewComboBoxColumn in this blog post. Currently this is the available solution for this scenario.
2. You should keep the keep the code as it is, using the Value, not Text. There is no need anything to be done differently.

If you have any further questions regarding this, please contact us. 

All the best,
Didie
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Joshua
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or