Accordion SelectedIndex Problem

Last post 07-03-2008 9:19 PM by Jonathan Shen – MSFT. 3 replies.

Sort Posts:

  • Accordion SelectedIndex Problem

    07-01-2008, 11:16 AM
    • Member
      8 point Member
    • fendtt62
    • Member since 06-23-2008, 4:20 PM
    • Posts 27

     What I'm trying to accomplish is to have all the panes collapsed when the page loads.  I set the SelectedIndex property to -1.

    While the page is loading for a brief moment all the panes are collapsed then when the page is done loading the first pane opens.

     I've searched and searched, this problem is driving me crazy!

    Any ideas?!?

    Thanks ahead.

  • Re: Accordion SelectedIndex Problem

    07-02-2008, 10:23 PM
    Answer

    Hi Fendtt62,

    To achieve your goal, you may follow these steps:

      1. Check whether one of the panes in the Accordion is expanded or not, if yes, save the SelectedIndex.
      2. Raise the click event of the selected pane’s Header in the Button’s onclick event to collapse the expanded pane.

    For more, please reference to this thread.

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Accordion SelectedIndex Problem

    07-03-2008, 9:19 AM
    Answer
    • Member
      8 point Member
    • fendtt62
    • Member since 06-23-2008, 4:20 PM
    • Posts 27

     I do not want to collapse all of the panes on a button click but rather when the page loads. 

    I don't really develop pages, I develop modules for a portal.  There was a javascript problem between the portal and my module.

    The solution was I had to put the whole accordion in a div, span, or fieldset. Then the selectedIndex property would work.


     

  • Re: Accordion SelectedIndex Problem

    07-03-2008, 9:19 PM

    Hi Fendtt62,

    That's similar.  You shall collapse it on pageLoad on client.

    Best regards,

    Jonathan

    Jonathan Shen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (4 items)