Skip to main content
All docs
V24.2
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

BarButtonItem.DefaultDropDownLink Property

Assigns all core settings of a target link (caption, image, click event handler, and others) to this Bar Button Item.

Namespace: DevExpress.XtraBars

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

#Property Value

Type Description
BarItemLink

The link whose settings are to be copied.

#Remarks

If a Bar Button has a drop-down menu (see the ButtonStyle property description), you can disable the ActAsDropDown property to split this button into two elements:

  • The button itself. When users click it, the button’s own ItemClick event fires.
  • The drop-down button. Shows a drop-down menu when clicked.

The DefaultDropDownLink property allows you to associate the main button element with any bar item link from its drop-down menu. This way, the copied link becomes easily accessible since users don’t need to invoke a drop-down menu to click it.

The code below illustrates how to copy settings from the last clicked link.

Default Drop-Down Link

using DevExpress.XtraBars;

void UpdateDefaultButton(ItemClickEventArgs args) {
    btnMain.DefaultDropDownLink = args.Link;
}

// ItemClick event handlers for drop-down menu buttons
void OnBtn1Click(object sender, ItemClickEventArgs e) {
    UpdateDefaultButton(e);
    // Do something
}


void OnBtn2Click(object sender, ItemClickEventArgs e) {
    UpdateDefaultButton(e);
    // Do something
}

void OnBtn3Click(object sender, ItemClickEventArgs e) {
    UpdateDefaultButton(e);
    // Do something
}
See Also