Compartir a través de


View.SelectNodes Method (XPathNavigator)

Selects a range of nodes in a view based on the specified starting XML node.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

Syntax

'Declaration
Public MustOverride Sub SelectNodes ( _
    startNode As XPathNavigator _
)
'Usage
Dim instance As View
Dim startNode As XPathNavigator

instance.SelectNodes(startNode)
public abstract void SelectNodes(
    XPathNavigator startNode
)

Parameters

Exceptions

Exception Condition
InvalidOperationException

The SelectNodes method was called from an event handler for the Loading event.

ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

Remarks

If the specified range of nodes is bound to more than one control in the view, you must use the SelectNodes(XPathNavigator, XPathNavigator, String) method. This allows you to specify the ViewContext identifier of the control that is bound to the range of nodes you want to select.

Note

The SelectNodes method requires that the specified nodes be structurally selectable in the view.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

Examples

In the following example, the SelectNodes(startNode) method is used to select the nodes in the first row in a Repeating Table control bound to group2.

// Create XPathNavigator and specify XPath for nodes.
XPathNavigator repeatingTableRow1 = 
   CreateNavigator().SelectSingleNode(
   "/my:myFields/my:group1/my:group2[1]", NamespaceManager);

// Select nodes in specified XPathNavigator.
CurrentView.SelectNodes(repeatingTableRow1);
' Create XPathNavigator and specify XPath for nodes.
Dim repeatingTableRow1 As XPathNavigator  = _
   CreateNavigator().SelectSingleNode( _
   "/my:myFields/my:group1/my:group2[1]", NamespaceManager)

' Select nodes in specified XPathNavigator.
CurrentView.SelectNodes(repeatingTableRow1)

See Also

Reference

View Class

View Members

SelectNodes Overload

Microsoft.Office.InfoPath Namespace