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

Display Yes/No instead of True/False in grid view

3 Answers 243 Views
GridView
This is a migrated thread and some comments may be shown as answers.
santosh
Top achievements
Rank 1
santosh asked on 14 Aug 2009, 07:03 AM
Hi,

I have a boolean data column which is displaying true/ false when bound to the grid view. Is there a way that i can format this column to display yes/ no instead.


thanks

santosh

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 17 Aug 2009, 02:10 PM
Hi santosh,

Thank you for writing. You can subscribe to CellFormatting event. The purpose of this event is to give users the opportunity to format the values in the cells as well. In the event handler, you can change the value of your cell to Yes if the underlaying value is true and to No otherwise. Please write back if you need further assistance.

All the best,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Raventhorn
Top achievements
Rank 2
answered on 18 Oct 2009, 10:45 PM
Can you give a code example of how this could be performed easily? In my case the GridView is displaying CheckBoxes instead of a text value. I want it to be Yes/No OR True/False...just not the CheckBoxes. I do not allow Editing or Adding of Grid values as this is a readonly grid.

Any help would be great.
0
Victor
Telerik team
answered on 20 Oct 2009, 08:38 AM
Hello Armysniper,

I have attached a small sample application to demonstrate how your goal can be achieved. Basically the column with the check boxes is hidden and another is added which takes its values from the hidden column. Please write again if you have other questions.

All the best,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
santosh
Top achievements
Rank 1
Answers by
Victor
Telerik team
Raventhorn
Top achievements
Rank 2
Share this question
or