jesus4u
Jun 20th, 2003, 11:29 AM
Is there an easier way to take control of a control in a DataList without doing the FindControl method?
Dim myDataListItem As DataListItem
For Each myDataListItem In DataList1.Items
If TypeOf myDataListItem Is Label Then
Dim lblText As Label = myDataListItem.FindControl("lblText")
lblText.Style.Item("left") = 0
Dim lblTitle As Label = myDataListItem.FindControl("lblTitle")
lblTitle.Style.Item("left") = 0
Else
Dim imgMain As Object = myDataListItem.FindControl("imgMain")
imgMain.Visible = False
End If
Next
Dim myDataListItem As DataListItem
For Each myDataListItem In DataList1.Items
If TypeOf myDataListItem Is Label Then
Dim lblText As Label = myDataListItem.FindControl("lblText")
lblText.Style.Item("left") = 0
Dim lblTitle As Label = myDataListItem.FindControl("lblTitle")
lblTitle.Style.Item("left") = 0
Else
Dim imgMain As Object = myDataListItem.FindControl("imgMain")
imgMain.Visible = False
End If
Next