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

Adding Expressions In Code

1 Answer 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 18 Aug 2014, 01:22 PM
Hi, i am trying to add expression to a textbox in code. I can easily do it in the design view like ([=Fields.name]). But i want to set this property in code. So how can i do it ?

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 20 Aug 2014, 01:44 PM
Hello Charles,

You can set the expression in the constructor of the report via the following code:
public partial class MyReport : Telerik.Reporting.Report
{
    public MyReport()
    {
        //
        // Required for telerik Reporting designer support
        //
        InitializeComponent();
 
        //
        // TODO: Add any constructor code after InitializeComponent call
        //
        this.textBox1.Value = "= Fields.name";
    }
}


Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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