ComponentOne DataObjects for .NET
C1ExpressView: Filtering, Sorting and Working with Tables in Other Forms
DataObjects for .NET Express Edition > C1ExpressView: Filtering, Sorting and Working with Tables in Other Forms

C1ExpressView is a component that can serve as a data source for data-aware controls, along with C1ExpressTable and C1ExpressConnection. It provides a view of a C1ExpressTable. This view can include only rows satisfying certain filter conditions, if such conditions are specified. This view can also sort the rows in a certain order. All these views are independent from one another, so you can show the same data filtered and sorted according to different conditions. Also, each C1ExpressView, being an independent data source, maintains its own current row, so you can use several views with a single C1ExpressTable if you need several representations with independent current row.

C1ExpressView also serves to allow binding of data-aware controls in one form to C1ExpressTable components residing in another form, see Working with Tables in Other Forms.

To attach a C1ExpressView to a C1ExpressTable component, set the ExpressTable property (or ExpressTableName if you need to attach it to a C1ExpressTable residing in another form).

To sort C1ExpressView rows, set the Sort property to the sort field name. To sort by multiple fields use coma as the delimiter:

To filter C1ExpressView rows, restrict the C1ExpressView rowset to only those rows that satisfy a certain condition, set the RowFilter property to a filter expression. For example,

To write code in Visual Basic

Visual Basic
Copy Code
C1ExpressView.RowFilter = "City = 'London'"

To write code in C#

C#
Copy Code
c1ExpressView.RowFilter = "City = 'London'";

See DataObjects for .NET Expressions for a description of DataObjects for .NET expression language.

C1ExpressView also allows to filter by row state, showing, for example, only added rows, or only modified rows, or deleted rows (note that this is the only way to access deleted rows), or original rows (original rows are the rows with their respective field values as they were fetched from the database, before any user modifications made to them). To filter rows by row state, use the RowFilter property which can have one of the following values (default: Current):

Value Description
Added New rows.
CurrentRows Current rows including unchanged, new, and modified rows.
Deleted Deleted rows.
ModifiedCurrent Current rows excluding new and unchanged rows.
ModifiedOriginal Original rows excluding deleted and unchanged rows.
OriginalRows Original rows including deleted and unchanged rows.
Unchanged Unchanged rows.
See Also