The problem I have is going deeper, n levels deep. One needs to able to extract the DataKeys of parent datalists. This is not good enough as done in the sample on this site:
' store the customer id to re-bind in the orders list ViewState(_customerID) = CType(e.Item.FindControl("CustomerID"), Label).Text
This is almost a hack around the platform. I need a way to do the following:
Assign a subroutine to the OnItemCommand event of a datalist and have the subroutine be the same for all child datalists, n levels deep in the hierarchy. Navigate back up to the parent datalist's DataKey value to extract it and to use it for some processing
at the child event firing level.
Public Sub cmd_Subroutine(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs)
' some code omitted instantiating vars below
dlsChild = CType(source, DataList)
dlsParent = CType(dlsChild.Parent , DataList)
str_IHaveAParent = dlsParent.ID
I am getting Nothing as the value for str_IHaveAParent. How do I get the value for str_IHaveAParent ?
Thank you so much for your attention to this issue. Kind regards!
DebonairDC
Member
7 Points
2 Posts
Drill-Down Report 4 levels deep
Jan 17, 2006 09:43 PM|LINK
This is almost a hack around the platform. I need a way to do the following:
Assign a subroutine to the OnItemCommand event of a datalist and have the subroutine be the same for all child datalists, n levels deep in the hierarchy. Navigate back up to the parent datalist's DataKey value to extract it and to use it for some processing at the child event firing level.
Public Sub cmd_Subroutine(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs)
' some code omitted instantiating vars below
dlsChild = CType(source, DataList)
dlsParent = CType(dlsChild.Parent , DataList)
str_IHaveAParent = dlsParent.ID
I am getting Nothing as the value for str_IHaveAParent. How do I get the value for str_IHaveAParent ?
Thank you so much for your attention to this issue. Kind regards!