Skip to main content

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

NavigatorButtonsBase.ButtonCollection Property

Provides access to the collection of built-in buttons displayed in the DataNavigator control.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[Browsable(false)]
public NavigatorButtonCollectionBase ButtonCollection { get; }

#Property Value

Type Description
NavigatorButtonCollectionBase

A NavigatorButtonCollectionBase object representing the collection of built-in buttons.

#Remarks

The ButtonCollection property provides access to the control’s built-in button collection. Individual buttons contained within the collection can be accessed using index notation using the NavigatorButtonCollectionBase.Item property.

You can add custom buttons with the NavigatorButtonsBase.CustomButtons collection. The display order of custom buttons can be changed using the NavigatorCustomButton.Index property.

#Example

The following code creates a new DataNavigator control, binds it to a data source, and specifies custom images for control buttons at runtime. Custom images are stored in an ImageCollection object.

DataNavigator ctor

using DevExpress.XtraEditors;

private void CreateDataNavigator() {
    // Create a new DataNavigator control
    DataNavigator dataNavigator = new DataNavigator();
    Controls.Add(dataNavigator);
    dataNavigator.Height = 40;
    dataNavigator.Dock = DockStyle.Bottom;
    // Bind to a data source
    dataNavigator.DataSource = productsBindingSource;
    // Specify the ImageCollection that stores custom images for DataNavigator buttons
    dataNavigator.Buttons.ImageList = imageCollection1;
    for (int i = 0; i < dataNavigator.Buttons.ButtonCollection.Count; i++) {
        dataNavigator.Buttons.ButtonCollection[i].ImageIndex = i;
    }
    dataNavigator.ShowToolTips = true;
}
See Also