AccordionControl.ForEachElement(Action<AccordionControlElement>) Method

Performs a certain action for each AccordionControl element.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v20.1.dll

Declaration

public void ForEachElement(
    Action<AccordionControlElement> handler
)
Public Sub ForEachElement(
    handler As Action(Of AccordionControlElement)
)

Parameters

Name Type Description
handler Action<AccordionControlElement>

An action to perform against each element.

Remarks

The ForEachElement method iterates through all elements and invokes the specified action for them.

The following code shows how you can perform an action on elements:


accordionControl1.ForEachElement((el) => {
    //Do some action
    //Toggle visibility for Items
    if (el.Style == DevExpress.XtraBars.Navigation.ElementStyle.Item) {
        el.Visible = !el.Visible;
    }
});
See Also