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

Loading textbox based on data in another textbox

3 Answers 84 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bob Bruce
Top achievements
Rank 1
Bob Bruce asked on 28 Jan 2010, 03:06 PM
I need to load a textbox with data based on the contents of another texbox.   I want to load the unbound textbox txtRiders based on the value of the bound textbox txtOptionID.  Here's what I tried:

 

 

    Private Sub txtOptionID_ItemDataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtOptionID.ItemDataBound
       
    Dim txtOpt As Telerik.Reporting.Processing.TextBox = DirectCast(sender, Telerik.Reporting.Processing.TextBox)

         If txtOpt.Value.ToString ="1"
             txtRiders.Value = "New Item 1"
         End If

    End Sub


Your help is, as always, appreciated.

 

3 Answers, 1 is accepted

Sort by
0
Bob Bruce
Top achievements
Rank 1
answered on 28 Jan 2010, 03:12 PM
More info.

The code I sent works, but only on the last group.  The report is grouped by OptionID, the data bound to txtOptionID.  It appears that only the last instance of txtRider in the DetailSection, gets loaded.
0
Steve
Telerik team
answered on 29 Jan 2010, 05:12 PM
Hello Bob,

You should always work with the processing report objects when you are in the context of an event, thus do not use definition items such as txtRiders (more info on definition vs. processing here). You can see a sample code in this help article: How do I combine values of two columns to a single TextBox?.

Regards,
Steve
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Bob Bruce
Top achievements
Rank 1
answered on 29 Jan 2010, 07:48 PM
Thanks.  I have resolved the problem.  I am getting more comfortable with the report events and object instancing.
Tags
General Discussions
Asked by
Bob Bruce
Top achievements
Rank 1
Answers by
Bob Bruce
Top achievements
Rank 1
Steve
Telerik team
Share this question
or