DataView

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public class DataView implements Iterable

Represents a databindable, customized view of a DataTable for sorting, filtering, searching, editing, and navigation.

Constructors

ConstructorDescription
DataView(System.Data.DataTable table)Initializes a new instance of the DataView class with the specified DataTable.

Methods

MethodDescription
close()Closes the DataView.
get(int recordIndex)Gets a row of data from a specified table.
getCount()Gets the number of records in the DataView.
getTable()Gets the source DataTable.
iterator()Gets an enumerator for this DataView.

DataView(System.Data.DataTable table)

public DataView(System.Data.DataTable table)

Initializes a new instance of the DataView class with the specified DataTable.

Parameters:

ParameterTypeDescription
tableDataTableA DataTable to add to the DataView.

close()

public void close()

Closes the DataView.

get(int recordIndex)

public System.Data.DataRowView get(int recordIndex)

Gets a row of data from a specified table.

Parameters:

ParameterTypeDescription
recordIndexintThe index of a record in the DataTable.

Returns: DataRowView - A DataRowView of the row that you want.

getCount()

public int getCount()

Gets the number of records in the DataView.

Returns: int - The number of records in the DataView.

getTable()

public System.Data.DataTable getTable()

Gets the source DataTable.

Returns: DataTable - A DataTable that provides the data for this view.

iterator()

public Iterator iterator()

Gets an enumerator for this DataView.

Returns: java.util.Iterator - An java.util.Iterator for navigating through the list.