Access parent repeater item from child repeater
hi, ok i got 2 repeaters:
parent: rpActiveCategory
child: rpActiveSubCategory
now on my child's OnItemDataBound I need to access 'Eval("Name")' form the
parent repeater.
Also I am populating my child repeater from my parent OnIteDataBound.
aspx.vb:
Code:
Protected Sub rpActiveCategory_OnItemDataBound(ByVal s As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim Category As Category = e.Item.DataItem
'---------------------------------------
'populate rpActiveSubCategory
Dim SubCategoryList As New SubCategoryList
Dim myParams As New Params
myParams.Activated = "true"
myParams.Type = "interior"
myParams.OrderBy = "ordered ASC"
myParams.CategoryID = Category.Idkey
SubCategoryList = SubCategoryManager.GetList(myParams)
Dim rpActiveSubCategory As Repeater = e.Item.FindControl("rpActiveSubCategory")
'bind data to repeater
rpActiveSubCategory.DataSource = SubCategoryList
rpActiveSubCategory.DataBind()
End If
End Sub
Protected Sub rpActiveSubCategory_OnItemDataBound(ByVal s As Object, ByVal e As RepeaterItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Dim SubCategory As SubCategory = e.Item.DataItem
Dim lblActiveSubCategoryTitleText As New Label
lblActiveSubCategoryTitleText.Text = SubCategory.Name
End If
End Sub
anybody know how to do this, I did experiment with item.Parent, but no result
I could of just been doing it wrong tho'
Shem, September 8th, 2008 10:39 AM
Bookmarks