Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight Accordion control: all collapsed when loaded

I'm currently working on a project where I have an Accordion control on the MainPage. It all works just as intended, but there's a small problem that I cannot seem to get my head around.

When I load the page, the first accordion is expanded. Is there any work-around to tell the Accordion control, that all the accordions should be collapsed when first loaded?

Also, I can click to expand the items, but when I click on the same item that I just expanded, it won't collapse again. Anyone know which event I should reach for here?

Thanks in advance.

All the best,

Bo

like image 624
bomortensen Avatar asked Dec 14 '09 14:12

bomortensen


1 Answers

You need to change the SelectionMode property to ZeroOrOne the default is One which means it will insist on having at least one item open.

Set the SelectedIndex property to -1 to hide all items.

like image 83
AnthonyWJones Avatar answered Nov 14 '22 14:11

AnthonyWJones