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

Sub Report dynamic style name

1 Answer 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 03 Aug 2012, 07:56 PM
Hi!

I'm currently working with a sub report, and trying to set the stylename of a textbox dynamically in code based on it's value.

switch (data.Value)
    {
        case "Value1":
            tbxScanState.StyleName = "Stylename1";
            break;
        case "Value2":
                tbxScanState.StyleName = "Stylename2";
                break;
    }

However, it seems that this changes the stylename for tbxScanState in all of the subreports, rather than just the subreport I'm currently working with. Do you know how I might achieve my goal?

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 08 Aug 2012, 02:17 PM
Hi Bob,

The provided information is insufficient for us to suggest anything concrete. Can you clarify where is this code used? In general the reporting engine allows you to style the report via Conditional Formatting or Bindings, where you get the value of the TextBox directly by using =Fields.RespectiveField.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Bob
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or