Back to Devexpress

AccordionControl.ItemContextButtons Property

windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-accordioncontrol-cce56f80.md

latest4.8 KB
Original Source

AccordionControl.ItemContextButtons Property

Stores context buttons, shared among all AccordionControl items.

Namespace : DevExpress.XtraBars.Navigation

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DXCategory("Appearance")]
public AccordionContextItemCollection ItemContextButtons { get; }
vb
<DXCategory("Appearance")>
Public ReadOnly Property ItemContextButtons As AccordionContextItemCollection

Property Value

TypeDescription
AccordionContextItemCollection

A DevExpress.Utils.ContextItemCollection object that stores context buttons, shown by all items within this AccordionControl.

|

Remarks

AccordionControl can display context buttons for items and groups. These buttons are stored within the AccordionControl.ItemContextButtons and AccordionControl.GroupContextButtons collections respectively. The figure below illustrates different context button sets for accordion items and groups.

Button Types

Available button types include:

Create Buttons

Use the Context Button Editor to create and customize buttons at design time.

If you need to hide specific context buttons from individual accordion elements or modify particular buttons in any other manner, handle the AccordionControl.ContextButtonCustomize event. See the event description for an example.

Accordion elements may also display any control within their header area if this control is assigned to the element’s HeaderControl property. This control does not replace context buttons, meaning both of them can be simultaneously displayed.

Handle Button Clicks

Handle the ContextButtonClick event to respond to button clicks. Use the e.Item property to get the clicked context button.

csharp
using DevExpress.XtraBars.Navigation;

private void accordionControl1_ContextButtonClick(object sender, DevExpress.Utils.ContextItemClickEventArgs e) {
    if(e.Item is AccordionRatingContextButton) {
        // Handle context button click.
    }
}
vb
Imports DevExpress.XtraBars.Navigation

Private Sub accordionControl1_ContextButtonClick(ByVal sender As Object, ByVal e As DevExpress.Utils.ContextItemClickEventArgs)
    If TypeOf e.Item Is AccordionRatingContextButton Then
        ' Handle context button click.
    End If
End Sub

See Also

GroupContextButtons

HeaderControl

HeaderIndent

AccordionControl Class

AccordionControl Members

DevExpress.XtraBars.Navigation Namespace