Cannot Expand Accordion Item after clicking on the Header
-
Wednesday, September 26, 2012 2:04 AM
Hello everyone, I am trying to build an Online Entertainment Project with Silverlight Application. I have used two Accordion controls and then added two Accordion Items. The code is below
<LayoutToolkit:Accordion x:Name="Accordion1" Selection Mode="one" Expand Direction="Right"
Selection Sequence="CollapseBeforeExpand" Margin="0,0">
<layoutToolkit: AccordionItem Header="Bollywood Songs" FontSize="20"><HyperlinkButton
NavigateUri="http://localhost:5040/OnlineEntertainment_Web/BollywoodSongs.aspx">
<Image Source="E:/Academics/Images/Bollywoodsongs.png" Stretch="None" Cursor="Hand" />
</HyperlinkButton>
</layoutToolkit:AccordionItem><layoutToolkit: AccordionItem Header="English Songs" FontSize="20">
<HyperlinkButton
NavigateUri="http://localhost:5040/OnlineEntertainment_Web/EnglishSongs.aspx">
<Image Source="E://Academics/Images/EnglishSongs.png" Stretch="None" Cursor="Hand" />
</HyperlinkButton>
</layoutToolkit:AccordionItem>
</layoutToolkit: Accordion>Now the issue is that when I am running the program and clicking on any one of the Header the Accordion Item(Image) is not getting expanded.
Can anybody please help with this problem. Any extra feature needed to add in the code ?
All Replies
-
Wednesday, September 26, 2012 8:20 AM
http://stackoverflow.com/questions/1901127/silverlight-accordion-control-all-collapsed-when-loaded
http://stackoverflow.com/questions/4696963/interactive-items-in-silverlight-accordion-header
http://stackoverflow.com/questions/1628557/accordion-item-not-in-correct-visual-state
-
Thursday, September 27, 2012 4:21 AMModerator
Hi pilu007,
I tried your code and shows as expected, so the issue may comes from the setting of the Image source, please try create a new folder(Images) under the Silverlight project and copy those images into it, then set the Image source to "Images/Bollywoodsongs.jpg ".
Best Regards,
-
Thursday, September 27, 2012 1:37 PM
Hello, Haixia Xie, thanks for your confirmation. I have already added the folder and named it Images. Not sure why this is not happening.
-
Thursday, September 27, 2012 10:00 PMModerator
Not sure why this is not happening.
I have uploaded the test project to skydrive and here is the link. For your information.
Best Regards,
-
Monday, October 01, 2012 2:16 PM
Hello Haixia Xie, thanks a ton for creating this project. I have just tested your project and it is working fine. However in my case I have detected one difference and that is regarding the Folder Creation. I have modified it though but still the same thing. I don't know whether any mistake is there which is not getting on spotted actually. I have uploaded my project to skydrive. Please go thorugh the Link below.
Please if you can help me regarding this thing.
-
Monday, October 01, 2012 9:28 PMModerator
Please go thorugh the Link below.
The project cannot be accessed, please set the accessing properties by right click the file->Properties.
Best Regards,
-
Tuesday, October 02, 2012 12:22 PM
Hello Can you please try the link this time http://sdrv.ms/UDZ0Ms
-
Tuesday, October 02, 2012 12:26 PM
Hello,
Not sure though whether the previous link would work. However I have shared the link via the url:
https://skydrive.live.com/redir?resid=48221CEB83D956BF!109&authkey=!AOo8J6tkBPqUU68
Please let me know if you face any issue.
-
Tuesday, October 02, 2012 9:35 PMModerator
Please let me know if you face any issue.
Is it a OnlineEntertainment.7z file? I cannot decompress or open it, please compress it to .zip file.
-
Saturday, October 06, 2012 2:52 AM
Hello Haixia,
Very Sorry to disturb you again. Also sorry for late reply. I am facing a new issue now regarding Assembly Reference while using Accordion Control in XAML. Please refer to the link below.
https://skydrive.live.com/redir?resid=48221CEB83D956BF!110&authkey=!AEhIBCAEYGB7kQU
I am not sure what is the exact problem. I am using .Net Framework 4. Silverlight 5 and also Selected WebApplication Project. In the book it was suggesting to go for New Website Template. I have tried it also but no luck. I guess there is nothing wrong in the code. I am also adding the code which is given in the book while defining the layoutToolkit part.
<UserControl xmlns:layoutToolkit="clr=-
namespace:System.Windows.Controls; assembly=System.Windows.Controls.Layout.Toolkit" X:Class=OnlineEntertainment.page"
Can you please help me out.
-
Saturday, October 06, 2012 3:33 AM
Hello Haixia, I have analyzed and sorted the assembly reference issue. However the picture is still not getting expanded.
https://skydrive.live.com/redir?resid=48221CEB83D956BF!111&authkey=!AHFwvcQdiB92aqI
Please access this winzip File to review the code.
-
Sunday, October 07, 2012 10:16 PMModerator
Please access this winzip File to review the code.
I mean create a folder under the silverlight project and copy & paste the images into the folder, shown in below image.

And modify your code as, the accordion will getting expanded:
<layoutToolkit:Accordion x:Name="Accordion2" SelectionMode="One" ExpandDirection="Right" SelectionSequence="CollapseBeforeExpand" Margin="0,0"> <layoutToolkit:AccordionItem Header="Bollywood Movies" FontSize="20"> <HyperlinkButton NavigateUri="http://localhost:5040/OnlineEntertainment_Web/MusicVideos.aspx"> <Image Source="Images/1.jpg" Stretch="Uniform" Cursor="Hand" /> </HyperlinkButton> </layoutToolkit:AccordionItem> <layoutToolkit:AccordionItem Header="English Songs" FontSize="20"> <HyperlinkButton NavigateUri="http://localhost:5040/OnlineEntertainment_Web/MiscellaneousVideos.aspx"> <Image Source="Images/2.jpg" Stretch="None" Cursor="Hand" /> </HyperlinkButton> </layoutToolkit:AccordionItem> </layoutToolkit:Accordion>Best Regards,
-
Sunday, October 07, 2012 10:26 PMModerator
This is the modified project based on your uploaded project, for your information.
Best Regards,
-
Friday, October 12, 2012 4:08 AM
Hello Haixia, thanks for your effort. I will sort it out. I have marked your reply as answer. Might be I am doing some silly mistakes that's why the issue persists. But anyways looking forward to get some more help in near future.
-
Friday, October 12, 2012 5:12 AMModerator
Welcome!

