Skip to main content

BreadCrumbEdit.GoBack() Method

Navigates back to the previous entry in the navigation journal.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v23.2.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void GoBack()

Remarks

The GoBack method activates the path stored by a previous BreadCrumbHistoryItem in the RepositoryItemBreadCrumbEdit.History collection. To discard this navigation, call the BreadCrumbEdit.GoForward method.

Example

The following example implements forward and backward navigation through history in the Breadcrumb editor:

WinForms Breadcrumb Editor - Navigation through History, DevExpress

using System;

namespace DXApplication {
    public partial class Form1 : DevExpress.XtraEditors.XtraForm {
        public Form1() {
            InitializeComponent();
            UpdateButtonStates();
            breadCrumbEdit1.SelectedNodeChanged += BreadCrumbEdit1_SelectedNodeChanged;
        }

        void BreadCrumbEdit1_SelectedNodeChanged(object sender, DevExpress.XtraEditors.BreadCrumbSelectedNodeChangedEventArgs e) {
            UpdateButtonStates();
        }

        void buttonBack_Click(object sender, EventArgs e) {
            breadCrumbEdit1.GoBack();
        }

        void buttonForward_Click(object sender, EventArgs e) {
            breadCrumbEdit1.GoForward();
        }

        void buttonUp_Click(object sender, EventArgs e) {
            breadCrumbEdit1.GoUp();
        }
        void UpdateButtonStates() {
            buttonBack.Enabled = breadCrumbEdit1.CanGoBack;
            buttonForward.Enabled = breadCrumbEdit1.CanGoForward;
            buttonUp.Enabled = breadCrumbEdit1.CanGoUp;
        }
    }
}
See Also