Skip to main content
Bar

BarCustomContainerItem.GetItemData Event

Allows you to supply child items for the BarCustomContainerItem object, or to customize existing child items.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public event EventHandler GetItemData

Event Data

The GetItemData event's data class is EventArgs.

Remarks

The GetItemData event may be raised multiple times during the application run. For example:

  • The form is about to be shown.
  • Child items are about to be displayed (for example, when the popup menu is invoked).
using DevExpress.XtraBars;

private void barSubItem1_GetItemData(object sender, EventArgs e) {
    var barSubItem = sender as BarSubItem;
    if(barCheckItem1.Checked) {
        ToggleLinksVisibility(barSubItem: barSubItem, isVisible: false);
    }
    else
        ToggleLinksVisibility(barSubItem);
}
void ToggleLinksVisibility(BarSubItem barSubItem, bool isVisible = true) {
    foreach(BarItemLink itemLink in barSubItem.ItemLinks)
        itemLink.Visible = isVisible;
}
See Also