Skip to main content
A newer version of this page is available. .

AccordionControl.ContextButtonCustomize Event

Fires before any context button is shown and allows you to dynamically customize it.

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v19.1.dll

Declaration

[DXCategory("Events")]
public event AccordionControlContextButtonCustomizeEventHandler ContextButtonCustomize

Event Data

The ContextButtonCustomize event's data class is DevExpress.XtraBars.Navigation.AccordionControlContextButtonCustomizeEventArgs.

Remarks

Accordion controls provide the AccordionControl.GroupContextButtons and AccordionControl.ItemContextButtons collections that store context buttons for groups and items respectively. The ContextButtonCustomize event is raised before any button is displayed. You can handle this event to modify a button, as shown in the sample code below.


void accordionControl1_ContextButtonCustomize(object sender, AccordionControlContextButtonCustomizeEventArgs e) {
    //Item context buttons are shown only for items that have a content container assigned
    if (e.Element.Style == ElementStyle.Item && e.Element.ContentContainer != null) e.ContextItem.Visibility = DevExpress.Utils.ContextItemVisibility.Visible;
}
See Also