Obtiene una vista personalizada de la tabla que puede incluir una vista filtrada o una posición del cursor.
Espacio de nombres: System.Data
Ensamblado: System.Data (en system.data.dll)

Sintaxis
Visual Basic (Declaración)
Public ReadOnly Property DefaultView As DataView
Dim instance As DataTable
Dim value As DataView
value = instance.DefaultView
public DataView DefaultView { get; }
public:
property DataView^ DefaultView {
DataView^ get ();
}
/** @property */
public DataView get_DefaultView ()
public function get DefaultView () : DataView
Valor de propiedad
Objeto
DataView asociado al objeto
DataTable.

Comentarios
La propiedad DefaultView devuelve un DataView que se puede utilizar para ordenar, filtrar y buscar un DataTable.

Ejemplo
En el ejemplo siguiente se establece una propiedad de DataView del objeto DataTable mediante la propiedad DefaultView. En el ejemplo también se muestra el enlace de un control DataGridView a un objeto DataTable denominado "Suppliers" que incluye una columna denominada "CompanyName".
Private Sub BindDataGrid()
Dim table As New DataTable
' Insert code to populate a DataTable with data.
' Bind DataGrid to DataTable
DataGrid1.DataSource = table
End Sub
Private Sub ChangeRowFilter()
Dim gridTable As DataTable = _
CType(dataGrid1.DataSource, DataTable)
' Set the RowFilter to display a company names
' that begin with A through I.
gridTable.DefaultView.RowFilter = "CompanyName < 'I'"
End Sub
private void BindDataGrid()
{
DataTable table = new DataTable();
// Insert code to populate a DataTable with data.
// Bind grid to DataTable.
dataGrid1.DataSource = table;
}
private void ChangeRowFilter()
{
DataTable gridTable = (DataTable) dataGrid1.DataSource;
// Set the RowFilter to display a company names that
// begin with A through I..
gridTable.DefaultView.RowFilter = "CompanyName < 'I'";
}

Plataformas
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter Edition
.NET Framework no admite todas las versiones de cada plataforma. Para obtener una lista de las versiones admitidas, vea Requisitos del sistema.

Información de versión
.NET Framework
Compatible con: 2.0, 1.1, 1.0
.NET Compact Framework
Compatible con: 2.0, 1.0

Vea también