Version

NavigateTo(String,Object) Method

Creates a NavigationHistoryItem with the specified parameters and sets it as the current item.
Syntax
'Declaration
 
Public Overloads Sub NavigateTo( _
   ByVal text As String, _
   ByVal tag As Object _
) 
public void NavigateTo( 
   string text,
   object tag
)

Parameters

text
The text to display when the item is shown in the recent history menu. Cannot be null or empty.
tag
An optional object to associate with the item.
Remarks

Similarly to how the navigation works in an explorer window in Vista, when navigating to a new item, a new path is started and the forward history is cleared.

Example
The following snippet handles an UltraTree's AfterSelect event to add the node to the navigation history so that the two elements can be in sync.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win.UltraWinTree

Private isNodeSelectedFromNavigationToolbar As Boolean

' Handles the UltraTree's AfterSelect event
Private Sub tvwFolders_AfterSelect(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinTree.SelectEventArgs) Handles tvwFolders.AfterSelect
	Dim selectedNode As UltraTreeNode = IIf(e.NewSelections.Count = 1, e.NewSelections(0), Nothing)
	If (selectedNode Is Nothing) Then Return

	'	Make sure that this node's Nodes collection is populated so
	'	that if the end user double-clicks on an item, we will be able
	'	to locate the associated sub-directory.
   Me.PopulateNodesCollection(selectedNode)

	'	Populate the UltraListView with the sub-folders and files 
	'	for the directory associated with the node that was selected
	Me.PopulateListView(selectedNode)

	' Update the current navigation item to the node that we've now selected, assuming
	' that the tree was navigated directly and not through the navigation history of the
	' NavigationToolbar.
	If Me.isNodeSelectedFromNavigationToolbar = False Then
		'We only want to show the text in the drop-down menu, but store the node itself in the
		' Tag property of a NavigationHistoryItem so that we have easy access to it later should
		' the user traverse the navigation history.
		Me.UltraToolbarsManager1.NavigationToolbar.NavigateTo(selectedNode.Text, selectedNode)
	End If
End Sub

' Handles the UltraToolbarsManager's AfterNavigation event.
Private Sub UltraToolbarsManager1_AfterNavigation(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinToolbars.AfterNavigationEventArgs) Handles UltraToolbarsManager1.AfterNavigation
	' Set a flag so that we know that we shouldn't add a new item to the navigation history.
	Me.isNodeSelectedFromNavigationToolbar = True

	' Since we've stored each node in the Tag property of a NavigationHistoryItem, we can now
	' easily select that node now.
	CType(e.CurrentItem.Tag, UltraTreeNode).Selected = True            

	' Reset the flag to allow subseqent additions to the navigation history.
	Me.isNodeSelectedFromNavigationToolbar = False
End Sub
using Infragistics.Win.UltraWinTree;

private bool isNodeSelectedFromNavigationToolbar;

/// <summary>
/// Handles the UltraTree's AfterSelect event
/// </summary>
private void tvwFolders_AfterSelect(object sender, SelectEventArgs e)
{
	// Update the current navigation item to the node that we've now selected, assuming
	// that the tree was navigated directly and not through the navigation history of the
	// NavigationToolbar.
	if(!this.isNodeSelectedFromNavigationToolbar)               
		// We only want to show the text in the drop-down menu, but store the node itself in the
		// Tag property of a NavigationHistoryItem so that we have easy access to it later should
		// the user traverse the navigation history.
		this.ultraToolbarsManager1.NavigationToolbar.NavigateTo(selectedNode.Text, selectedNode);
}

/// <summary>
/// Handles the UltraToolbarsManager's AfterNavigation event.
/// </summary>
private void ultraToolbarsManager1_AfterNavigation(object sender, Infragistics.Win.UltraWinToolbars.AfterNavigationEventArgs e)
{
    // Set a flag so that we know that we shouldn't add a new item to the navigation history.
    this.isNodeSelectedFromNavigationToolbar = true;

    // Since we've stored each node in the Tag property of a NavigationHistoryItem, we can now
    // easily select that node now.
    ((UltraTreeNode)e.CurrentItem.Tag).Selected = true;

    // Reset the flag to allow subseqent additions to the navigation history.
    this.isNodeSelectedFromNavigationToolbar = false;
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also