|
-
Feb 11th, 2005, 09:39 AM
#1
Thread Starter
Lively Member
Nested repeater control and custom dataset
hi
im using nested repeater control in asp.net page.
two control names are:
1. packg -outer repeater
2. rptr - inner repeater
now the datasource for packg (outer control) is comming from database
and the datasourcer for rptr (inner control) is my own datatable.
how to bind this in my page.
'----------coding im using in ItemDataBound of outer repater control----
Private Sub packg_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles packg.ItemDataBound
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim rpt As Repeater = CType(e.Item.FindControl("rptr"), Repeater)
If Not (rpt Is Nothing) Then
Dim WsI As Integer
Dim WsCart As New DataTable()
WsCart.Columns.Add(New DataColumn("tempcol", GetType(String)))
WsCart.Columns.Add(New DataColumn("DivId", GetType(String)))
For WsI = 1 To 3
Dim WsRow As DataRow = WsCart.NewRow
WsRow("tempcol") = "rptr__ctl" & WsI & "_txtTitl," & "rptr__ctl" & WsI & "_txtLstNm," & "rptr__ctl" & WsI & "_txtfstNm," & "rptr__ctl" & WsI & "_lstadt"
WsRow("Divid") = "rptr__ctl" & WsI & "_"
wsDetStr = wsDetStr & "::" & WsRow("DivId")
WsCart.Rows.Add(WsRow)
Next
rptr.DataSource = '---here i want to bind the second repeater
rptr.DataBind()
End If
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|