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

Dynamically update TextBox value

2 Answers 477 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Evan
Top achievements
Rank 1
Evan asked on 22 Sep 2007, 01:34 AM

I'm trying to update the value of a textbox with the following code.

ReportViewer1.Report = (Telerik.Reporting.Report)new AllItems();

Telerik.Reporting.TextBox txt = (Telerik.Reporting.TextBox)ReportViewer1.Report.Items["txtTitle"];

txt.Value = "wow";

It errors out giving a "The expression contains object 'ID' that is not defined in the current context."

Can this be done?

2 Answers, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 24 Sep 2007, 11:43 AM
Hi Evan,

Most probably this error is raised in another TextBox bound to the data field with expression like "=ID", but in the DataSource this field is missing.

We will suggest using our Reporting designers in Visual Studio 2005, which will help you with the Report design and edit. The report definition is generated in the InitializeComponent() method and it is a good example how to write such a definition. 


Sincerely yours,
Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 11 Oct 2007, 11:36 PM
Evan,

I personally do not suggest doing it this way, the textbox item should already be able to be seen, so you should only have to do something like this.

txtTextbox.value = "Some Value";
Tags
General Discussions
Asked by
Evan
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
John
Top achievements
Rank 1
Share this question
or