Blog Home  Home Feed your aggregator (RSS 2.0)  
Implements IVillage - Ajax Control Toolkit 61121Prod Bug in Accordion
It takes a village to keep up with .Net
 
 Tuesday, December 05, 2006

When workin with the Accordion control in my previous post, I encountered a bug that made life a bit frustrating.  Everytime I broke into the debugger on the ItemDataBound event handler and expanded the event - Crash!  Whenever the display got to e.Item, things stopeed and got funky.  Stop debug and restart.  Create a watch for e.AccordionItem... don't expand the evil e.  I finally took some time and dove into the Accirdion's source code.

I kept looking at this over and over again and could not figure out what was going on and then it clicked - Stack Overflow!  There is a recursive call in the AccordionItemEventArgs class:

        /// <summary>
        /// Container
        /// </summary>

        private IDataItemContainer DataItem
        {
            get { return Item as IDataItemContainer; }
        }

        /// <summary>
        /// DataItem being bound to the Container
        /// </summary>

        public object Item
        {
            get { return DataItem.DataItem; }
        }

When the debugger evaluates Item to display it for you, it calls the DataItem property which in turn calls the Item property and so on...

Going to submit this to the Ajax bug list.  I am modifying my copies definition of the Item property as follows:

        /// <summary>
        /// DataItem being bound to the Container
        /// </summary>
        public Object Item
        {
            get { return _item.DataItem; }
        }  
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Copyright © 2008 Christian M Loris. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.