NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataView.RowFilter

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);

Property Value

A string that specifies how rows are to be filtered. For more details, see the Remarks below.

Remarks

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'"

Example [Visual Basic]

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

See Also

DataView Class | DataView Members | System.Data Namespace | Expression | Sort