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.v22.1.dll
NuGet Package: DevExpress.Win.Navigation
Declaration
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