I am trying to access div tags within DataGroupTemplate from ItemDataBound but nothing is coming up for me. Not sure what i'm missing or might I be taking the wrong approach here?
<
DataGroups
>
<
telerik:ListViewDataGroup
GroupField
=
"Level"
DataGroupPlaceholderID
=
"DataGroupPlaceHolder1"
>
<
DataGroupTemplate
>
<
div
id
=
"Div1"
runat
=
"server"
>
<
div
id
=
"Div2"
runat
=
"server"
>
<
span
class
=
"GroupText"
><%# CType(Container, RadListViewDataGroupItem).DataGroupKey%></
span
>
</
div
>
<
asp:PlaceHolder
runat
=
"server"
ID
=
"DataGroupPlaceHolder2"
></
asp:PlaceHolder
>
</
div
>
</
DataGroupTemplate
>
</
telerik:ListViewDataGroup
>
</
DataGroups
>
Protected Sub RadListView1_ItemDataBound(sender As Object, e As RadListViewItemEventArgs) Handles RadListView1.ItemDataBound
If e.Item.ItemType = RadListViewItemType.DataItem Then
Dim dataitem As RadListViewDataItem = CType(e.Item, RadListViewDataItem)
If dataitem IsNot Nothing Then
Dim grpdiv As HtmlGenericControl = TryCast(e.Item.FindControl("Div1"), HtmlGenericControl)
If grpdiv IsNot Nothing Then
'Do something
End If
End If
End If
End Sub