awiinc
asked on
Dynamic UserControls and delegates
How does one gain access to delegate within a dynamically loaded usercontrol. Here is short snippet of code:
Dim ctlControl As UserControl
ctlControl = LoadControl("~/FolderName/ TomsTree.a scx")
PlaceHolder1.Controls.Add( ctlControl )
ctlControl = LoadControl("~/FolderName/ MyDataGrid .ascx")
PlaceHolder1.Controls.Add( ctlControl )
TomsTree has a delegate that needs to communicate with MyDataGrid when an event occurs. This works perfectly if I declare the controls at design time...but how would I add an event handler and addressof to dynamically loaded controls such as this?
Dim ctlControl As UserControl
ctlControl = LoadControl("~/FolderName/
PlaceHolder1.Controls.Add(
ctlControl = LoadControl("~/FolderName/
PlaceHolder1.Controls.Add(
TomsTree has a delegate that needs to communicate with MyDataGrid when an event occurs. This works perfectly if I declare the controls at design time...but how would I add an event handler and addressof to dynamically loaded controls such as this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nice, it is good to know!
ASKER
How do I award EugeneTrukhin 100 points for responding. I would like to delete this question from ASP.NET since I have figured the problem out without receiving an answer. If this is not possible then just award Eugene all 250 points.
i think moderator can delete this topic.
or u can award yourself :)
ASKER
Can he delete and award you 100 points for responding?
ASKER
Dim obj1 As ucWithDelegate = CType(PlaceHolder1.FindCon
Dim obj2 As uclisteningforDelegate = CType(PlaceHolder1.FindCon
AddHandler obj1.CategoryChanged, AddressOf obj2.CategoryChanged