-
how to Edit Child datalist in a parent Datalist
I have 2 datalists on my webform, got them both working.
Then, I put the child datalist in the ItemTemplate of the parent, and in the
Item_DataBound of the parent added the child Datalist
That works too - EXCEPT, when I click my child control's edit button, how do
I get:
1) the child datalist control so that I can set the EditItemIndex?
My parent Datalist onItemDatabound code below:-
Sub DataList_OnitemDB(ByVal sender As Object, ByVal e As DataListItemEventArgs)
If e.Item.ItemType = ListItemType.Item Or _
e.Item.ItemType = ListItemType.AlternatingItem Then
'Build the DataGrid
Dim dg As New DataList
Dim lb As New Label
'Find out the CategoryID
Dim Desc As Integer = e.Item.DataItem("DescID")
Dim Cat As Integer = e.Item.DataItem("CatID")
Dim rat As String = e.Item.DataItem("rating")
'newwly created Datalist in the parent Datalist
Dim g As DataList = CType(e.Item.FindControl("dg"), DataList)
'Create a DataView that has only the applicable FAQs
Dim myview As DataView = myDS.Tables("Season").DefaultView
myview.RowFilter = "DescID=" & Desc & "AND CatID = '" & Cat & "'" & "AND [rating] = '" & rat & "'"
g.DataSource =myview
g.DataBind()
'added the child datalist control
e.Item.Controls.Add(g)
End If
End Sub
How can i edit the child datalist?
Similar Threads
-
Replies: 2
Last Post: 03-21-2006, 08:32 PM
-
Replies: 0
Last Post: 01-30-2006, 08:24 AM
-
Replies: 0
Last Post: 02-07-2002, 05:46 PM
-
Replies: 1
Last Post: 02-07-2001, 08:18 PM
-
By Matthew Cromer in forum VB Classic
Replies: 0
Last Post: 09-12-2000, 08:53 AM
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks