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

Conditional Formatting on TextBox wher the value has been assigned by code

2 Answers 623 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeannot Diderrich
Top achievements
Rank 1
Jeannot Diderrich asked on 03 May 2010, 08:18 PM
Hello,

In my code I assign the string "HIGH" to a TextBox in my Report. The report shows the value "HIGH" correctly in the report. I would like to format the TextBox in such a way that the text's colr is Red when it contains "HIGH". Therefore I have created a Conditional Formatting Rule saying  that if TextBoxName.Value = ="HIGH" (see attached image) the the style should have a red font color.

However this does not work. Dies conditional formatting work if the value of the textbox is assigned directly through code?

Any help is appreciated.

Thanks in advance

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 May 2010, 09:31 AM
Hi Jeannot Diderrich,

In expressions, you cannot refer to some report item in the report using its identifier / Name. Full list of the supported constructs and more information on expressions you may find in the help chapter Expressions.

However, expressions do provide a way to refer the current item - the one which property uses the expression with the global object ReportItem:

=ReportItem.Value

And the whole filter would be:

=ReportItem.Value  =  ="HIGH"

or just

=ReportItem.Value  =  HIGH

as the ="HIGHT" evaluates to constant anyway.

Greetings,


Peter
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.
0
Ionel
Top achievements
Rank 1
answered on 02 Aug 2011, 10:37 AM
Hi,

I was looking for a solution to exactly the same problem as described above.
I've tried both approaches you suggested using ReportItem and the value as String (="Value") then as a contant  (Value) in the filter.
None of them have worked!
Please advise me on this as soon as possible!
Thanks!

Ionel Mihai
Tags
General Discussions
Asked by
Jeannot Diderrich
Top achievements
Rank 1
Answers by
Peter
Telerik team
Ionel
Top achievements
Rank 1
Share this question
or