Visual Basic Development Bookmark and Share   
 Home > Visual Basic Power Packs > datarepeater template area
 

datarepeater template area

Hello
I am using a datarepeater control with VS 2008 SP1 to display photos and information of dogs on a Win Form. I have the dogs picture, and 3 bound text boxes with information associated with the animal. I have a click event handler on the picture that should when click retrieve some information from the text boxes and update a dataset. When I step thru the code though, all of the text boxes are showing empty strings even though there is data in them.

Do I need to reference the controls different?

Private Sub DogPicture_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DogPicture.Click
        Try
            'Debug.Print(Me.StatusTextBox.Text)
            If Me.StatusTextBox.Text = "OUT" Then
                Me.DogsBindingSource.EndEdit()
                Me.DogsTableAdapter.UpdateStatus("IN", Me.txtDogID.Text)
                Me.DogsTableAdapter.DDogs(Me.DS.Dogs)
            Else
                Me.DogsBindingSource.EndEdit()
                Me.DogsTableAdapter.UpdateStatus("OUT", Me.txtDogID.Text)
                Me.DogsTableAdapter.DDogs(Me.DS.Dogs)
            End If

        Catch ex As Exception

        End Try
    End Sub
Thanks! Ryan
Ryanls  Thursday, September 24, 2009 5:40 PM
Hi Ryan,

You can't access the control directly because he actual controls for each RepeaterItem are created at runtime. See John Chen's post here for an explanation of how to reference the controls: http://blogs.msdn.com/vsdata/archive/2009/09/08/writing-event-handler-for-controls-in-a-datarepeateritem.aspx

Hope this helps,
Steve Hoag Microsoft aka the V-Bee
  • Marked As Answer byRyanls Saturday, September 26, 2009 12:26 PM
  •  
shoagMSFT  Friday, September 25, 2009 8:04 PM
Hi Ryan,

You can't access the control directly because he actual controls for each RepeaterItem are created at runtime. See John Chen's post here for an explanation of how to reference the controls: http://blogs.msdn.com/vsdata/archive/2009/09/08/writing-event-handler-for-controls-in-a-datarepeateritem.aspx

Hope this helps,
Steve Hoag Microsoft aka the V-Bee
  • Marked As Answer byRyanls Saturday, September 26, 2009 12:26 PM
  •  
shoagMSFT  Friday, September 25, 2009 8:04 PM
Thanks, that helped alot

Ryan
Ryanls  Saturday, September 26, 2009 12:26 PM

You can use google to search for other answers

Custom Search

More Threads

• The Data Repeater control is released!
• moving shapes with mouse at runtime
• How to Make a DLL or Class Library using PowerPacks?
• I Really Need Ur HELP.....
• I'm new to this aspect of adding a reference etcetera, please help.AC
• Plain-text printing on dot-matrix printer
• Printform and Windows 2000
• button click in datarepeater
• How to Start with Visual basic Experss 2008
• Printing reports