System.Web.UI.WebControls.XmlDataSourceView Class

Represents a tabular data source view on XML data for an System.Web.UI.WebControls.XmlDataSource control.

See Also: XmlDataSourceView Members


public sealed class XmlDataSourceView : System.Web.UI.DataSourceView


The System.Web.UI.WebControls.XmlDataSource control can present its underlying data in both tabular and hierarchical format to Web server controls that bind to it. Controls such as System.Web.UI.WebControls.GridView or System.Web.UI.WebControls.DropDownList use the System.Web.UI.WebControls.XmlDataSource to bind to XML data and present it in list or tabular form, while controls that derive from the System.Web.UI.WebControls.HierarchicalDataBoundControl class, such as System.Web.UI.WebControls.TreeView, bind to XML data and present it in hierarchical form.

The System.Web.UI.WebControls.XmlDataSource creates each view type internally through different code paths. If the System.Web.UI.IDataSource.GetView(string) method is called on the System.Web.UI.WebControls.XmlDataSource, an System.Web.UI.WebControls.XmlDataSourceView is created by the System.Web.UI.WebControls.XmlDataSource. If the XmlDataSource.GetHierarchicalView(string) method is called, an System.Web.UI.WebControls.XmlHierarchicalDataSourceView is created. The System.Web.UI.WebControls.XmlDataSourceView class is provided for Web server controls that derive from System.Web.UI.WebControls.DataBoundControl and bind to lists and tabular data, while the System.Web.UI.WebControls.XmlHierarchicalDataSourceView is provided for Web server controls that derive from System.Web.UI.WebControls.HierarchicalDataBoundControl and bind to hierarchical data. Internally, all data-bound control methods call the Select method on whichever data source view object is returned.

Like all System.Web.UI.DataSourceView helper objects, the System.Web.UI.WebControls.XmlDataSourceView defines the operations that the data source can perform with the underlying data. Because the System.Web.UI.WebControls.XmlDataSourceView class only overrides the System.Web.UI.HierarchicalDataSourceView.Select method, the associated System.Web.UI.WebControls.XmlDataSource control does not support update, insert, or delete operations. Because the System.Web.UI.WebControls.XmlDataSourceView class is sealed, you cannot extend the System.Web.UI.WebControls.XmlDataSourceView class to add this functionality, but you can derive a data source control from System.Web.UI.WebControls.XmlDataSource and a view from System.Web.UI.DataSourceView if you require additional functionality.


Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0