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

NavigatorCustomButton.Index Property

Gets or sets the visual position of the current custom button within the combined list of the built-in and custom buttons.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

[DefaultValue(-1)]
[DXCategory("Behavior")]
public int Index { get; set; }

#Property Value

Type Default Description
Int32 -1

A zero-based value that specifies the visual position of the current custom button within the combined list of the built-in and custom buttons. -1 if the custom button is displayed at the end of this list.

#Remarks

When custom buttons are added to the NavigatorButtonsBase.CustomButtons collection, the navigator control displays them after the built-in buttons (NavigatorButtonsBase.ButtonCollection), by default. Use the Index property to change the visual position of custom buttons.

Before displaying buttons, the navigator control creates a combined list of the built-in and custom buttons. First, it adds the built-in buttons to this list. Then, custom buttons are inserted to this list according to their Index property values. For instance, if a custom button has the Index property set to 1, this button is inserted at the second position (indexes are zero-based). If the Index property is set to -1, this custom button is added at the end of the combined list. Thus, the Index property allows you to insert custom buttons before the built-in buttons or between them.

See Also