Couple of things, I think there is bug in the code; In the while loop
while ((method == null) && (methodOwner != null))
{
method = methodOwner.GetType().GetMethod(delegateName);
methodOwner = methodOwner.Parent;
}
if method has been found, mothodowner should not be changed as it is needed to invoke the event. so it should be
while ((method == null) && (methodOwner != null))
{
method = methodOwner.GetType().GetMethod(delegateName);
if(method != null)
methodOwner = methodOwner.Parent;
}
In addition to this, you dont need
if (method == null)
{
methodOwner = AdaptedControl.Page;
method = methodOwner.GetType().GetMethod(delegateName);
}
as, while going through all the partents, you will reach to the Page ultimately, i.e evantually, methodowner.parent will be equal to Page.
Here is what I have used in my code. I have tested it for my needs and it is working fine. Please let me know there is still a bug for some other scnario that i have not been tested against.
Russ, on a different subject, I have also found additional bugs, one of them is described at setting ShowCheckBox = true & node hyperlink disappears?? and other is with the css, In my tree view, I have added a background color to the selected nodes in the css by setting
.PrettyTree
div.AspNet-TreeView .AspNet-TreeView-Selected a
{
color: #ECED15 !important;
background-color: #165EA9 !important;
padding: 3px !important; }
in the TreeViewExample css, the problem I am having is that , if the selected node has some childrens then the same background is also applied to all the children in the selected node ??? , ( used on IE 7). Any help ??
Grewal
http://www.mycoolaids.com/