Databound inside DataList with another DataList

S

Steve

Hi,

I have a problem here with bounding data inside a datalist.

Currently I am working on a page which I can have a list of items
using a datalist(listA). Inside this datalist(listA) i would like to
bound with another datalist(listB) so I am able to list items in listB
based on the unique value on listA.

here's the code that I kinda have...

' this is the databound for listA
Private Sub listA_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataListItemEventArgs) Handles
listA.ItemDataBound


Dim listB As datalist
listB = e.item.findControl("listB")

' the problem occurs here, I have a column called "ItemNum" in listB
and I want to use this ItemNum and based on this ItemNum I will go to
the database and search for approprivate values for other columns(i.e.
CodeA, CodeB, CodeC).
I was thinking to use ANOTHER listC to do that but it seems like it
goes too deep and doesn't work at all.

listB.DataBind()


Dim lblItemNum As Label
lbItemNum = listB.FindControl("ItemNum")


dataRowsB = dataSetB.Tables("tableB").Select("ItemNum = " &
lbItemNum.Text)

' this comes to an error since it was trying to access the LIST of
itemNum in ListB, how would I do something similar to ItemDataBound as
like in listA? I notice that I am not able to access something like
"Private Sub .... Handles listA.ItemDataBound" for listB. Where can I
do something like this so I can access each item in listB?



End Sub


Hope everyone understands what I meant. Thanks for everyone's help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top