Gets or sets the expression used to filter which rows are viewed in the DataView.
[Visual Basic] Public Property RowFilter As String [C#] public string RowFilter {get; virtual set;} [C++] public: __property String* get_RowFilter(); public: __property virtual void set_RowFilter(String*); [JScript] public function get RowFilter() : String; public function set RowFilter(String);
A string that specifies how rows are to be filtered. For more details, see the Remarks below.
To form a RowFilter value, specify the name of a column followed by an operator and a value to filter on. The value must be in quotes. For example:
"LastName = 'Smith'"
See the DataColumn class's Expression property for more information.
To return only those columns with null values, use the following expression:
"Isnull(Col1,'Null Column') = 'Null Column'"
The following example creates a DataView and sets its RowFilter property.
[Visual Basic]
Private Sub MakeDataView() Dim dv As DataView dv = New DataView With dv .Table = DataSet1.Tables("Suppliers") .AllowDelete = True .AllowEdit = True .AllowNew = True .RowFilter = "City = 'Berlin'" .RowStateFilter = DataViewRowState.ModifiedCurrent .Sort = "CompanyName DESC" End With ' Simple bind to a TextBox control Text1.Bindings.Add("Text", dv, "CompanyName") End Sub
DataView Class | DataView Members | System.Data Namespace | Expression | Sort