Setting the SelectedIndex of an Accordian object to the last item causes a crash

Last post 11-08-2007 4:32 AM by hermiod. 1 replies.

Sort Posts:

  • Setting the SelectedIndex of an Accordian object to the last item causes a crash

    08-29-2006, 12:23 PM
    • Member
      5 point Member
    • sculver
    • Member since 08-29-2006, 4:18 PM
    • Posts 1

    I am running the latest build (July) of the framework and the control toolkit.
    I want to have an accordian that can dynamically be added to.  I have an accordian and a button both within an Update Panel, when the user selects the button, I add a new Accordian Pane to the accordian and have the update panel set to refresh on this event.

    That all seems to work just fine, except when I want to set the selected index to the item I just created.  If I set the index to any number index before the last item, everything works just fine.  When I try to set it to the index of the last item, the browser hangs and I eventually have to close it (Task Manager style).  Again it only seems to be an issue when setting it to the last index.

     Any assistance would be greately appreciated.  Thanks

    Filed under:
  • Re: Setting the SelectedIndex of an Accordian object to the last item causes a crash

    11-08-2007, 4:32 AM
    • Member
      204 point Member
    • hermiod
    • Member since 08-30-2007, 8:31 AM
    • Posts 82

    I've just started playing around with the Accordion myself. Tough little bugger to get going isn't it?

    I'm pretty sure the Accordion, as with most .Net controls, has a zero-based index. So if you have 5 panes in the accordion their indexes will be 0,1,2,3,4.

    To test this, add an event to the accordion that will print out the header text of a pane. Set the index to the number of panes -1 and then see what text appears. If its the text of your last pane, then you know that is it a zero-based index.

    I haven't a clue how you could do this personally as I've just had a quick look and it appears the Accordion has no text, rows, columns, item, items properties so how you get your hands on the text of a specific pane is anyone's guess.

    Sorry for bumping the thread. I found it in a search and didn't realise what the date was!

    Please Mark As Answer if this post helped you.
Page 1 of 1 (2 items)