Reference - Getting all values from a repeater control - asp.net

Discussion in 'ASP .Net' started by mrwoopey, Apr 15, 2004.

  1. mrwoopey

    mrwoopey Guest

    I did not see code for getting all values from a repeater control
    posted anywhere. So, I figured it out and I am posting for the next
    person that may need it (sorry if this seems obvious to you):

    '''''''''''''''''''''''''''''''''''''

    Dim strValue As String
    Dim objCTL As Control

    For Each objCTL In RepeaterExisting.Controls
    strValue = objCTL.GetType.ToString
    If strValue = "System.Web.UI.WebControls.RepeaterItem"
    Then

    Dim objCurrentRepeaterItem As RepeaterItem =
    DirectCast(objCTL, RepeaterItem)

    If objCurrentRepeaterItem.ItemType.ToString = "Item"
    Or objCurrentRepeaterItem.ItemType.ToString = "AlternatingItem" Then

    Dim objDDL As DropDownList =
    DirectCast(objCurrentRepeaterItem.Controls(1), DropDownList)


    Dim objDLC As DataBoundLiteralControl =
    DirectCast(objCurrentRepeaterItem.Controls(0),
    DataBoundLiteralControl)

    lblMessage.Text = lblMessage.Text & " Drop down =
    " & objDDL.SelectedValue & ", source = " & objDLC.Text() & "<BR>"

    End If

    End If

    Next

    ''''''''''''''''''''''''''''''''''''''

    Phin
     
    mrwoopey, Apr 15, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mrwoopey
    Replies:
    0
    Views:
    2,244
    mrwoopey
    Apr 15, 2004
  2. Replies:
    0
    Views:
    889
  3. sck10
    Replies:
    4
    Views:
    2,906
    sck10
    Jan 5, 2007
  4. Rock

    Getting values from control to control to control

    Rock, Oct 19, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    134
  5. Replies:
    8
    Views:
    484
Loading...

Share This Page