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.
返回
返回一个表示数据单一视图的 XmlHierarchicalDataSourceView 对象,该数据从 viewPath 标识的数据节点开始。Returns an XmlHierarchicalDataSourceView object that represents a single view of the data starting with the data node identified by viewPath.
注解
可以调用 GetHierarchicalView 方法来检索 XmlHierarchicalDataSourceView 与控件关联的对象 XmlDataSource 。You can call the GetHierarchicalView method to retrieve a XmlHierarchicalDataSourceView object associated with the XmlDataSource control. 如果指定 viewPath 值,则 XmlDataSource 控件返回一个数据源视图对象,该对象表示由标识的节点上的视图及其 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. 如果将设置 viewPath 为 String.Empty ,则 XmlDataSource 控件将检查 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 控件将使用它来返回数据源视图,其方式与使用表达式的方式相同 viewPath 。If 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.