49
Vote

Accordion item does not resize when content size changes.

description

There was a work item for this issue that says it was fixed in the July toolkit, but the problem still exists in the October toolkit? When the content grows horizontally, accordian item expands both vertically and horizontally. If content grows vertically, accordion item does not grow. Select another accordion item, then select the item with resized content, accordion item sizes vertically correctly. I'm having trouble uploading an example, email me if you would like to see it.

comments

RJacobs wrote Nov 9, 2009 at 9:22 PM

Example attached

wrote Nov 9, 2009 at 9:24 PM

wrote Dec 1, 2009 at 6:19 PM

wrote Dec 17, 2009 at 11:03 PM

wrote Jan 22, 2010 at 3:15 PM

wrote Feb 10, 2010 at 12:49 PM

wrote Feb 10, 2010 at 1:39 PM

wrote Feb 27, 2010 at 12:11 PM

wrote Mar 25, 2010 at 12:57 AM

simonjohnroberts wrote Apr 25, 2010 at 3:58 AM

Any idea if this will be fixed? or at least a workaround?

wrote Apr 25, 2010 at 3:58 AM

wrote May 7, 2010 at 9:10 AM

wrote May 27, 2010 at 7:48 AM

wrote Jun 3, 2010 at 4:16 AM

clunemann wrote Jun 3, 2010 at 4:22 AM

The impact of this issue for anyone dealing with dynamic content or in many other cases is not "Low".

It would seam that Accordion is loaded with sizing problems, not only with the content, but also as a whole. E.g., items will expand beyond browser size and defined regions without putting max height controls on it.

wrote Jul 7, 2010 at 1:27 PM

torsteinr wrote Jul 7, 2010 at 1:36 PM

I use the accordion control to wrap a listbox. This issue is a problem for me every time an item is added to the listbox.

wrote Jul 7, 2010 at 1:46 PM

wrote Jul 7, 2010 at 4:48 PM

wrote Jul 7, 2010 at 6:23 PM

wrote Jul 21, 2010 at 11:49 AM

wrote Jul 31, 2010 at 7:27 PM

wrote Aug 10, 2010 at 2:59 AM

jperl wrote Aug 10, 2010 at 3:00 AM

I just have a custom control inside. Same issue, i hope this is fixed.

wrote Aug 10, 2010 at 4:21 AM

simonjohnroberts wrote Aug 10, 2010 at 9:02 AM

Hi JPERL, I will try to dig out how I fixed mine.

I think in essence I actually reload the entire accoridon sub-section iirc to work around the issue.

There is a barely perceptible flicking whilst this occurs. it is acceptable. I have posted a working example project using this on http://forevony.com - Look at the "ForevonyLight" Timer,
With particular focus on the contents of one of the expanded nodes. Add another [+] co-ordinate holder, you will see the reload there.

If you want the code I used just ask.

wrote Sep 7, 2010 at 7:32 AM

wrote Sep 13, 2010 at 1:27 PM

wrote Sep 15, 2010 at 9:39 AM

wrote Oct 4, 2010 at 9:15 AM

lindsve wrote Oct 4, 2010 at 9:23 AM

"Low" impact? Seriously?

clunemann wrote Oct 4, 2010 at 12:21 PM

I abandoned the Accordion mainly to avoid this issue by creating my own Accordion through managing a Group of Expanders. Accordions are based on Expanders, but Expanders size correctly....
Consistancy is achieved through the use of Styles.
This may not work for every ones application...but thought I would throw it out there. It is the only reason why I think the issue may be considered low.

wrote Oct 21, 2010 at 8:09 AM

wrote Nov 13, 2010 at 1:56 AM

wrote Nov 19, 2010 at 4:50 PM

wrote Nov 30, 2010 at 12:16 PM

wrote Jan 13, 2011 at 6:40 PM

wrote Jan 20, 2011 at 9:55 PM

BrianJimdar wrote Jan 20, 2011 at 9:57 PM

+1. This issue continues and is source of developer pain.

simonjohnroberts wrote Jan 22, 2011 at 4:46 PM

Now officially tired of receiving the same updates on this issue...

While not perfect this works....

Enjoy

public static class AccordionItemExtensions
{
    /// <summary>
    /// Forces a selected AccordionItem to resize to its contents.
    /// Doesn't work for Accordion.SelectionModes: One, OneOrMore
    /// </summary>
    /// <param name="item">Selected AccordionItem to udpate.</param>
    public static void UpdateSize(this AccordionItem item)
    {
        item.Dispatcher.BeginInvoke(
            delegate
            {
                if (!item.IsLocked && item.IsSelected)
                {
                    item.IsSelected = false;
                    item.InvokeOnLayoutUpdated(delegate { item.IsSelected = true; });
                }
            });
    }
}
Then invoke it like UpdateSize(YourAccordianItem)

wrote Feb 21, 2011 at 8:44 AM

wisnia wrote Feb 21, 2011 at 8:45 AM

I have and datagrid in my accordion item. When I add/delete and item from the grid the size of the accordion item is not getting resized :/

wrote Feb 23, 2011 at 9:12 AM

wrote Mar 4, 2011 at 10:28 AM

wrote Mar 12, 2011 at 12:16 PM

wrote Mar 17, 2011 at 4:25 PM

wrote Apr 23, 2011 at 12:51 AM

wrote May 4, 2011 at 6:22 PM

wrote Jun 21, 2011 at 7:58 PM

wrote Jun 22, 2011 at 3:57 PM

wrote Jul 12, 2011 at 5:30 PM

sircmpwn wrote Jul 12, 2011 at 5:37 PM

This is still an issue.

wrote Jul 13, 2011 at 1:27 AM

wrote Aug 2, 2011 at 6:59 PM

wrote Sep 20, 2011 at 1:01 PM

trenttobler wrote Sep 26, 2011 at 4:36 PM

This is not "Low" impact. We have decided NOT to use the accordian item because of this issue; the work arounds did not always work.

wrote Sep 26, 2011 at 4:37 PM

wrote Oct 7, 2011 at 6:59 PM

wrote Nov 18, 2011 at 11:05 PM

wrote Jan 23, 2012 at 9:56 PM

maxima120 wrote Jan 26, 2012 at 4:30 PM

I too want this fixed !

wrote Mar 28, 2012 at 6:38 PM

wrote Apr 4, 2012 at 7:16 AM

wrote May 17, 2012 at 11:48 PM

wrote Nov 5, 2012 at 8:19 AM

wrote Feb 22, 2013 at 2:52 AM

SL_User wrote Jul 10, 2014 at 11:31 AM

Is it resolved in SL5? I am having the same issue and not able to get any solutions, tried a lot..