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

Setting textbox value programatically

2 Answers 617 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Martin P
Top achievements
Rank 1
Martin P asked on 10 Aug 2008, 09:14 PM
Before the last release I used to set a textbox value in the footer section programatically with the code below which worked ok, however since the update this doesn't now work??

Private Sub ReportFooterSection1_ItemDataBinding(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportFooterSection1.ItemDataBinding
    contractSumFunctionTextBox.Value = Format(membContract, "N0")
End Sub


tried contractSumFunctionTextBox.Value = 24 as a test but still nothing shows

???

2 Answers, 1 is accepted

Sort by
0
Martin P
Top achievements
Rank 1
answered on 10 Aug 2008, 09:31 PM
I may have answered my own question...

I was using the reportfooter binding as I am actually programatically setting a few textbox values in the footer.

I removed the reportfooter event handler and used textbox individual ones instead and this works...

  Private Sub contractSumFunctionTextBox_ItemDataBinding(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles contractSumFunctionTextBox.ItemDataBinding
    Dim txtPosition As Telerik.Reporting.Processing.TextBox = DirectCast(sender, Telerik.Reporting.Processing.TextBox)
    txtPosition.Value = membContract
  End Sub


still, something must've changed across releases?

0
Accepted
Rossen Hristov
Telerik team
answered on 11 Aug 2008, 07:46 AM
Hi Martin P,

You have got it correctly. In the ItemDataBinding and ItemDataBound events you should use the processing item (i.e. the sender cast to the respective type) if you want to change its value. To understand the report life cycle, please read this help topic. And this topic explains how report events work.

Best wishes,
Ross
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Martin P
Top achievements
Rank 1
Answers by
Martin P
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or