M
mrwoopey
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
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