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

Changing HtmlTextBox Value

2 Answers 216 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 30 Jan 2012, 03:44 PM
I'm sure I'm missing something obvious here, but I'm trying to set the text on a HtmlTextBox on its ItemDataBound event.  I set the Value property, but the output does not change from the default text.  This works with a TextBox, so I'm not sure what is different with the HtmlTextBox.


private void htmlTextBox1_ItemDataBound(object sender, EventArgs e)
        {
            Telerik.Reporting.Processing.HtmlTextBox txtBox = (Telerik.Reporting.Processing.HtmlTextBox)sender;
 
            txtBox.Value = "Updated";
        }


Yet the HtmlTextBox outputs the default value.

Thanks for any help / clarification.

2 Answers, 1 is accepted

Sort by
0
Accepted
Steve
Telerik team
answered on 30 Jan 2012, 04:02 PM
Hello Paul,

The HtmlTextBox has a parser which does its thing when the item is being bound (i.e. ItemDataBinding) and any changes after this event are irrelevant. If you need to programmatically change its Value Either use the ItemDataBinding event or create a Binding for the Value property of the HtmlTextBox and add as expression an User Function that makes the changes you need to.

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Paul
Top achievements
Rank 1
answered on 30 Jan 2012, 04:08 PM
I see how it works now.  I incorrectly assumed the parsing would occur after the ItemDataBound event. 

Thanks for the help!
Tags
General Discussions
Asked by
Paul
Top achievements
Rank 1
Answers by
Steve
Telerik team
Paul
Top achievements
Rank 1
Share this question
or