Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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