Accordion
Namespace: Wisej.Web
Assembly: Wisej.Framework (4.1.0.0)
Displays collapsible set of AccordionPanel panels for presenting information in a limited amount of space.
- C#
- VB.NET
public class Accordion : Control, ISupportInitialize
Public Class Accordion
Inherits Control
Implements ISupportInitialize
Constructors
Accordion()
Initializes a new instance of the Accordion class.
Accordion(panels, onSelectedIndexChanged)
Initializes a new instance of the Accordion class with the specified settings.
| Name | Type | Description |
|---|---|---|
| panels | AccordionPanel[] | An array of AccordionPanel objects to be added to the panel. |
| onSelectedIndexChanged | Action<Object, EventArgs> | An Action delegate to handle the SelectedIndexChanged event. |
Accordion(location, size, onSelectedIndexChanged)
Initializes a new instance of the Accordion class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | The location of the panel on its parent control. |
| size | Size | The size of the panel. |
| onSelectedIndexChanged | Action<Object, EventArgs> | An Action delegate to handle the SelectedIndexChanged event. |
Accordion(location, size, panels, onSelectedIndexChanged)
Initializes a new instance of the Accordion class with the specified settings.
| Name | Type | Description |
|---|---|---|
| location | Point | The location of the panel on its parent control. |
| size | Size | The size of the panel. |
| panels | AccordionPanel[] | An array of AccordionPanel objects to be added to the panel. |
| onSelectedIndexChanged | Action<Object, EventArgs> | An Action delegate to handle the SelectedIndexChanged event. |
Properties
BorderStyle
BorderStyle: Returns or sets the type of border that is drawn around the Accordion panel. (Default: Solid)
ClientArea
Rectangle: Returns the client rectangle to use in the designer.
Collapsible
Boolean: Returns or sets a value indicating whether the Accordion control collapses when all the AccordionPanel children are collapsed. (Default: False)
When this property is set to false (default) one panel is always expanded.
DisplayRectangle
Rectangle: Returns the rectangle that represents the virtual display area of the control.
HeaderSize
Int32: Returns or sets the size of the header. When the header is horizontal, the size if the height; when it's vertical, the size if the width. Set it to -1 to reset to the size set in the current theme.
ImageList
ImageList: Returns or sets the images to display on the panel's title bar. (Default: null)
PanelCount
Int32: Returns the number of panels in the container. (Default: 0)
Panels
PanelCollection: Returns the collection of panels in the container.
SelectedIndex
Int32: Returns or sets the index of the currently selected panel. (Default: -1)
Throws:
- ArgumentOutOfRangeException The value is less than -1.
SelectedOnTop
Boolean: Returns or sets a value indicating whether the selected panel is moved to the top of the Accordion container. (Default: False)
SelectedPanel
AccordionPanel: Returns or sets the currently selected panel. (Default: null)
ShowToolTips
Boolean: Returns or sets whether a panel's ToolTip is shown when the mouse passes over the panel's title. (Default: True)
Methods
CreateControlsInstance()
This member overrides CreateControlsInstance.
Returns: ControlCollection. A new instance of ControlCollection assigned to the control.
DeselectPanel(index)
Makes the AccordionPanel following the AccordionPanel with the specified index the current panel.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index in the Panels collection of the AccordionPanel to deselect. |
Throws:
- ArgumentOutOfRangeException index is less than 0 or greater than the number of AccordionPanel controls in the Panels collection minus 1.
DeselectPanel(panel)
Makes the AccordionPanel following the specified AccordionPanel the current panel.
| Parameter | Type | Description |
|---|---|---|
| panel | AccordionPanel | The AccordionPanel to deselect. |
Throws:
- ArgumentNullException panel is null.
DeselectPanel(panelName)
Makes the AccordionPanel following the AccordionPanel the specified name the current panel.
| Parameter | Type | Description |
|---|---|---|
| panelName | String | The Name of the panel to deselect. |
Throws:
- ArgumentNullException panelName is null; or panelName does not match the Name property of any AccordionPanel in the Panels collection.
GetControl(index)
Returns the AccordionPanel panel at the specified location.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index of the AccordionPanel to get. |
Returns: Control. The AccordionPanel at the specified location.
Throws:
- ArgumentOutOfRangeException index is less than 0 or greater than the number of AccordionPanel controls in the Panels collection minus 1.
GetItems()
Returns an array of AccordionPanel controls that belong to the Accordion control.
Returns: Object[]. An array of AccordionPanel controls that belong to the Accordion.
GetToolTipText(item)
Returns the ToolTip for the specified AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| item | Object | The AccordionPanel that owns the desired ToolTip. |
Returns: String. The ToolTip text.
OnControlAdded(e)
Fires the ControlAdded event.
| Parameter | Type | Description |
|---|---|---|
| e | ControlEventArgs |
OnDeselected(e)
Fires the Deselected event.
| Parameter | Type | Description |
|---|---|---|
| e | AccordionEventArgs | A TabControlEventArgs that contains the event data. |
OnDeselecting(e)
Fires the Deselecting event.
| Parameter | Type | Description |
|---|---|---|
| e | AccordionCancelEventArgs | A AccordionCancelEventArgs that contains the event data. |
OnEnter(e)
Fires the Enter event of the currently active AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | A EventArgs that contains the event data. |
OnLayout(e)
Fires the Layout event.
| Parameter | Type | Description |
|---|---|---|
| e | LayoutEventArgs | A LayoutEventArgs that contains the event data. |
OnLeave(e)
Fires the Leave event of the currently active AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | A EventArgs that contains the event data. |
OnSelected(e)
Fires the Selected event.
| Parameter | Type | Description |
|---|---|---|
| e | AccordionEventArgs | A AccordionEventArgs that contains the event data. |
OnSelectedIndexChanged(e)
Fires the SelectedIndexChanged event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | A EventArgs that contains the event data. |
OnSelecting(e)
Fires the Selecting event.
| Parameter | Type | Description |
|---|---|---|
| e | AccordionCancelEventArgs | A AccordionCancelEventArgs that contains the event data. |
OnWebEvent(e)
Processes the event from the client.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | Event arguments. |
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
RemoveAll()
Removes all the panels and additional controls from this tab control.
SelectPanel(index)
Makes the AccordionPanel with the specified index the current AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| index | Int32 | The index in the Panels collection of the tab to select. |
Throws:
- ArgumentOutOfRangeException index is less than 0 or greater than the number of AccordionPanel controls in the Panels collection minus 1.
SelectPanel(panel)
Makes the specified AccordionPanel the current AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| panel | AccordionPanel | The AccordionPanel to select. |
Throws:
- ArgumentNullException panel is null.
SelectPanel(panelName)
Makes AccordionPanel with the specified name the current AccordionPanel.
| Parameter | Type | Description |
|---|---|---|
| panelName | String | The Name of the tab to select. |
Throws:
- ArgumentNullException panelName is null; or panelName does not match the Name property of any AccordionPanel in the Panels collection.
Events
Deselected
AccordionEventHandler Fired when a panel is deselected.
Deselecting
AccordionCancelEventHandler Occurs before a panel is deselected, enabling a handler to cancel the panel change.
Selected
AccordionEventHandler Fired when a panel is selected.
SelectedIndexChanged
EventHandler Fired when the SelectedIndex property has changed.
Selecting
AccordionCancelEventHandler Occurs before a panel is selected, enabling a handler to cancel the panel change.
Implements
| Name | Description |
|---|---|
| IUserData | Provides access to the UserData and Tag properties associated to the component implementing this interface. |
| IBindableComponent | Bindable components implement this interface. |
| IDropTarget | Controls that support drag & drop operations implement this interface. |
| IWisejComponent | All wisej components implement this interface. |
| IWisejControl | All wisej controls derived from the Control class must implement this interface. |
| IWisejSerializable | Allows an object to serialize itself. |