Skip to main content

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