Chapter 28. The DataView Class
The DataView class is a
view onto a DataTable. Using the
DataView, you can apply sort or filter conditions
without modifying the underlying data. You can even create multiple
DataView objects to show different representations
of the same DataTable. The
DataView also provides methods for searching for
specific rows.
As with all disconnected data classes, the
DataView isn't specific to any
provider. DataView objects can be created
programmatically, but every DataTable also
provides a DefaultView property that contains a
default DataView. If you bind directly to a
DataTable, .NET automatically uses the
DataView contained in the
DefaultView property to determine what data should
be displayed. In addition, every DataSet provides
a DefaultViewManager property, which provides a
default DataViewManager. The
DataViewManager is primarily used when binding an
entire DataSet to a control (like the Windows
DataGrid). In this case, the control can use the
presets stored in the DataViewManager to generate
individual DataView objects for each
DataTable as required.
|