XmlDataSource.GetHierarchicalView(String) 方法

定義

取得 XmlDataSource 控制項的資料來源檢視物件。Gets the data source view object for the XmlDataSource control. viewPath 參數可以是 XPath 運算式。The viewPath parameter can be an XPath expression.

protected:
 override System::Web::UI::HierarchicalDataSourceView ^ GetHierarchicalView(System::String ^ viewPath);
protected override System.Web.UI.HierarchicalDataSourceView GetHierarchicalView (string viewPath);
override this.GetHierarchicalView : string -> System.Web.UI.HierarchicalDataSourceView
Protected Overrides Function GetHierarchicalView (viewPath As String) As HierarchicalDataSourceView

參數

viewPath
String

XPath 運算式,識別從中建置目前階層式檢視的節點。An XPath expression that identifies a node from which the current hierarchical view is built.

傳回

HierarchicalDataSourceView

傳回 XmlHierarchicalDataSourceView 物件,表示由 viewPath 所識別之資料節點開始的單一資料檢視。Returns an XmlHierarchicalDataSourceView object that represents a single view of the data starting with the data node identified by viewPath.

備註

您可以呼叫 GetHierarchicalView 方法,以取得 XmlHierarchicalDataSourceView 與控制項相關聯的物件 XmlDataSourceYou can call the GetHierarchicalView method to retrieve a XmlHierarchicalDataSourceView object associated with the XmlDataSource control. 如果您指定 viewPath 值, XmlDataSource 控制項會傳回資料來源 view 物件,該物件代表所識別之節點的視圖 viewPath ,以及其所有子節點。If you specify viewPath value, the XmlDataSource control returns a data source view object that represents the view on the node identified by viewPath, along with all its child nodes. 如果您將設定 viewPathString.EmptyXmlDataSource 控制項會檢查 XPath 屬性,以判斷用來建立資料來源視圖的根節點。If you set viewPath to String.Empty, the XmlDataSource control checks the XPath property to determine the root node from which to build the data source view. 如果 XPath 已設定屬性,則控制項會使用此屬性, XmlDataSource 以使用運算式的相同方式傳回資料來源視圖 viewPathIf the XPath property is set, the XmlDataSource control uses it to return a data source view in the same way the viewPath expression is used. 如果 XPath 未設定屬性, XmlDataSource 控制項會傳回 XML 資料中所有資料節點的視圖。If the XPath property is not set, the XmlDataSource control returns a view of all the data nodes in the XML data.

適用於