A
Adam Knight
Hi all,
I have two Datalists.
One is nested within the HTML of another.
What i need to do is determine the current item index of the parent datalist
in the OnItemBound of the child.
Public Sub dlDocumentTypes_ItemBound(ByVal Sender As Object, ByVal E As
DataListItemEventArgs)
Dim cmdSelectDocuments As SqlCommand
Dim dlDocumentLinks As DataList
'determine if current item is not a header of footer
If (E.Item.ItemType <> ListItemType.Header Or E.Item.ItemType <>
ListItemType.Footer) Then
'retrieve child DataList control from item
dlDocumentLinks = CType(E.Item.FindControl("dlDocumentLinks"),
DataList)
'get documents
cmdSelectDocuments = New SqlCommand("get_documents", Cn)
cmdSelectDocuments.CommandType = CommandType.StoredProcedure
cmdSelectDocuments.Parameters.Add(New SqlParameter("@standard",
ParentList.DataKeys(ParentList.ItemIndex))) ???
'bind data list to data source
dlDocumentLinks.DataSource = Ds.Tables("DocumentTypes")
dlDocumentLinks.DataBind()
End If
End Sub
Can anyone enlighten me???
Cheers,
Adam
I have two Datalists.
One is nested within the HTML of another.
What i need to do is determine the current item index of the parent datalist
in the OnItemBound of the child.
Public Sub dlDocumentTypes_ItemBound(ByVal Sender As Object, ByVal E As
DataListItemEventArgs)
Dim cmdSelectDocuments As SqlCommand
Dim dlDocumentLinks As DataList
'determine if current item is not a header of footer
If (E.Item.ItemType <> ListItemType.Header Or E.Item.ItemType <>
ListItemType.Footer) Then
'retrieve child DataList control from item
dlDocumentLinks = CType(E.Item.FindControl("dlDocumentLinks"),
DataList)
'get documents
cmdSelectDocuments = New SqlCommand("get_documents", Cn)
cmdSelectDocuments.CommandType = CommandType.StoredProcedure
cmdSelectDocuments.Parameters.Add(New SqlParameter("@standard",
ParentList.DataKeys(ParentList.ItemIndex))) ???
'bind data list to data source
dlDocumentLinks.DataSource = Ds.Tables("DocumentTypes")
dlDocumentLinks.DataBind()
End If
End Sub
Can anyone enlighten me???
Cheers,
Adam