The Accordion control represents a series of panes that can be viewed
one at a time. The control is used to create "strongly typed" access
to the AccordionBehavior. Its major purpose is to structure the content
in a way that the AccordionBehavior can understand it.
Reference to the AccordionExtender wrapped by the Accordion control
Determine how growth of the Accordion will be controlled. If it is set to
None, then the Accordion can grow as large or as small as necessary. If it is
set to Limit, then the Accordion will always be less than or equal to its
Height. If it is set to Fill then it will always be equal to its height.
Default Content CSS Class
Template for the Content of databound panes
Prevent the Controls property from appearing in the editor (so
that people will use the Panes collection instead)
Member in the DataSource to bind to
Gets or sets the data source that provides data for populating
the list of AccordionPanes.
The ID of the DataControl that this control should use to retrieve
its data source. When the control is bound to a DataControl, it
can retrieve a data source instance on-demand, and thereby attempt
to work in auto-DataBind mode.
Whether or not to use a fade effect when transitioning between selected
The number of frames per second used in the transition animation effects.
This is used to tune performance when using FadeTransition, a large number
of Accordion Panes, etc.
Default Header CSS Class
Default selected Header CSS Class
Template for the Header of databound panes
Whether or not the Accordion was databound using the DataSourceID
property rather than setting the DataSource directly
Collection of child panes in the Accordion
Whether or not clicking the header will close the currently opened pane (leaving
all the Accordion's panes closed)
Whether or not the control has already been databound, or still needs
to be databound
Arguments used to request data-related operations from
data source controls when data is retrieved
Index of the AccordionPane to be displayed
(this property must be set before OnPreRender)
Whether or not we suppress the client-side click handlers of any elements (including server
controls like Button or HTML elements like anchor) in the header sections of the Accordion.
Length of the transition animation in milliseconds
Default constructor that tells ASP.NET to render it as a DIV
Empty out the child Pane's collection
Connects this data bound control to the appropriate DataSourceView
and hooks up the appropriate event listener for the
DataSourceViewChanged event. The return value is the new view (if
any) that was connected to. An exception is thrown if there is
a problem finding the requested view or data source.
Create the AccordionExtender and attach it to the div
that will be generated for this control
Create the new control hierarchy of AccordionPanes
(using the DataSource if specificed)
Create the DataSourceSelectArguments (which just defaults to the Empty value
because we don't want to sort, filter, etc.)
|CreateItem(System.Object, System.Int32, AjaxControlToolkit.AccordionItemType, AjaxControlToolkit.AccordionContentPanel, System.Web.UI.ITemplate, System.Boolean)||
Create an AccordionPane's item (either Header or Content) and raise the ItemCreated event
Bind the Accordion to its DataSource
Select the data
Ensure that the Accordion has been databound if it needed to be
Override FindControl to look first at this control, then check each
of its child AccordionPanes for the control
Returns an IEnumerable that is the DataSource, which either came
from the DataSource property or from the control bound via the
Wrap the CommandArgs of an ItemCommand event with AccordionCommandEventArgs
DataBind the Accordion to its panes
This method is called when DataMember, DataSource, or DataSourceID is changed.
Indicate that we need to be databound whenever the DataSourceView changes
OnInit handler to wireup the Page's PreLoad event
Raise the ItemCommand event
Raise the ItemCreatedEvent
Raise the ItemDataBound event
Connect to the DataSourceView and determine if we still need to
OnPreLoad is used to determine whether or not we still need to databind the Accordion
Mark the selected AccordionPane so it does not appear collapsed
The AccordionBehavior is used to turn properly structured XHTML into an
Accordion with panes that can expand one at a time.
|FadeTransitions||Whether or not to fade the accordion panes when transitioning|
|FramesPerSecond||Number of steps per second in the transition animations.
The default value is 30 frames per second.|
This is the CSS class applied to each header.
This is the CSS class applied to the selected header.
Get a specific Accordion pane given its index. If no index is provided, get
the currently selected pane.
|requireOpenedPane||Whether or not clicking the header will close the currently opened pane
(which leaves all the Accordion's panes closed)|
|SelectedIndex||Index of the currently selected Accordion section|
|suppressHeaderPostbacks||Whether or not we suppress the client-side click handlers of any elements
(including server controls like Button or HTML elements like anchor) in the
header sections of the Accordion.|
|TransitionDuration||Length of time to transition between Accordion sections in
milleseconds. The default value is 250ms.|
Create a new Accordion pane given references to its header and content divs
and add it to the _panes collection. We also wrap the content div in a new
container div, add a click handler to the header div, etc.
Dispose of the AccordionBehavior
The initialize function is responsible for getting the selected index from
the ClientState mechanism and walking the children of the behavior's target
to find all of the accordion's child panes. It builds up a collection of the
panes from the headers and content sections. Then we hide all the content
sections that aren't selected and initialize the layout.
Raise the selectedIndexChanged event
Raise the selectedIndexChanging event