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

Conditional Format with Enums

1 Answer 238 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Bendtsen
Top achievements
Rank 1
Michael Bendtsen asked on 19 Jul 2010, 07:11 AM
I'm trying to do some conditional formatting and I want to use an enum from my datasource. What should the value look like? When I uses a string as value, it says that it cannot compare "enum" and string.

Best regards,
Michael

1 Answer, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 22 Jul 2010, 10:16 AM
Hi Michael Bendtsen,

You cannot compare enum values with strings directly because there is no implicit conversion between the two types. However you can use the ToString() method in the expression to convert the enum value to its string representation. Then you can compare the two strings as usual. I have attached a small sample project with a report that demonstrates this approach.

Regards,
Ivan
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
General Discussions
Asked by
Michael Bendtsen
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Share this question
or