Gets or sets the filter used on this table.
[Visual Basic] Public Property RowFilter As String [C#] public string RowFilter {get; set;} [C++] public: __property String* get_RowFilter(); public: __property void set_RowFilter(String*); [JScript] public function get RowFilter() : String; public function set RowFilter(String);
A filter expression that includes a column name, Boolean operator, and value to filter the table on.
See the Expression property of the DataColumn for details on forming the filter expression.
The following example creates a DataSetView and adds two TableSetting objects to the TableSettingsCollection. The first TableSetting sorts according to the CompanyName column and filters out all rows except for those named like "Smith." The second table sorts according to the OrderDate column, and filters out all non-null columns.
[Visual Basic]
' The next two lines go into the Declarations section of the module: Private myDataSetView As DataSetView ' CustomerOrders is a class derived from DataSet. Private CustOrders As CustomerOrders Private Sub CreateDataSetView() ' Not shown: CustomerOrders is already configured with tables, relations, constraints. myDataSet = New CustomerOrders myDataSetView = New DataSetView(myDataSet) End Sub Private Sub AddTableSettings() ' Create TableSetting and add it to TableSettingsCollection. Dim ts As TableSetting Dim srt As String Dim flt As String ' Sort by CompanyName column.' Filter out all rows except for rows where CustomerID = 'Smith' srt = "CompanyName" flt = "CustomerID = 'SMITH'" ts = New TableSetting(myDataSet.Tables("Suppliers"),srt, flt, DataViewRowState.CurrentRows) myDataSetView.TableSettings.Add(ts) ' Create and add second TableSetting. ts = New TableSetting(myDataSet.Tables("Orders")) ts.Sort = "OrderDate" ts.RowFilter = "IsNull(ShippedDate, 'null') = 'null'" myDataSetView.TableSettings.Add(ts) End Sub
TableSetting Class | TableSetting Members | System.Data Namespace | Expression | Sort | TableSetting