Skip to main content

AccordionControl.SelectedElement Property

Gets or sets the currently selected item. This property is in effect if item selection is enabled with the AccordionControl.AllowItemSelection property.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

[Browsable(false)]
[DefaultValue(null)]
public AccordionControlElement SelectedElement { get; set; }

Property Value

Type Default Description
AccordionControlElement null

The currently selected element.

Remarks

Items (elements whose AccordionControlElement.Style properties are set to Item) support the selected state, provided that the AccordionControl.AllowItemSelection property is enabled. A selected item is highlighted as specified by the current skin. Use the SelectedElement property or the AccordionControl.SelectElement method to select a certain element in code.

An end-user can select an item by clicking its header.

Note

Groups (elements whose AccordionControlElement.Style property is set to Group) do not support the selected state. Thus, they cannot be selected with the SelectedElement property, nor with the AccordionControl.SelectElement method.

To respond to changing the selected item, handle the AccordionControl.SelectedElementChanged event.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SelectedElement property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also