Skip to main content

AccordionControl.ContextButtonCustomize Event

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

Namespace: DevExpress.XtraBars.Navigation

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

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

Event Data

The ContextButtonCustomize event's data class is AccordionControlContextButtonCustomizeEventArgs. The following properties provide information specific to this event:

Property Description
ContextItem Gets a context item to customize.
Element Gets a AccordionControlElement that contains a context item to customize.

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