combit List & Label 25 - .NET Online Web Help
ApplyFilter Method
Example 


combit.ListLabel25.DataProviders Namespace > ITable Interface : ApplyFilter Method
Filter string "<FieldName>=<Value>". If you work with combined primary keys, you will get the key field name separated by tab as well as the values, e.g. "CustomerID\tOrderID=22\t14". If this parameter is empty, the row filter should be reverted and all rows should be selected again. See also ChildColumnName Property and ParentTableName Property.
This method is called to set a row filter on the rows of the table. The syntax of the passed in string is "<FieldName>=<Value>". The method will only be called if the SupportsFiltering Property returns true. If it doesn't, you don't need to implement this method and may safely throw a NotImplementedException. Be aware that your data provider will not be able to support drill down reporting in this case, however.
Syntax
'Declaration
 
Sub ApplyFilter( _
   ByVal filter As String _
) 
void ApplyFilter( 
   string filter
)
void ApplyFilter( 
   String^ filter
) 

Parameters

filter
Filter string "<FieldName>=<Value>". If you work with combined primary keys, you will get the key field name separated by tab as well as the values, e.g. "CustomerID\tOrderID=22\t14". If this parameter is empty, the row filter should be reverted and all rows should be selected again. See also ChildColumnName Property and ParentTableName Property.
Example
public void SetRowFilter(string rowFilter)
{
    DataViewSetting setting = _dataView.DataViewManager.DataViewSettings[_dataView.Table.TableName];
    if (String.IsNullOrEmpty(rowFilter))
    {
        setting.RowFilter = _savedRowFilter;
    }
    else
    {
        _savedRowFilter = setting.RowFilter;

        // convert row filter format to col='val'. Input is col=val.
        string[] parts = rowFilter.Split('=');
        string converted = parts[0] + "='" + parts[1] + "'";

        _dataView.RowFilter = converted;
        setting.RowFilter = converted;
    }
}
Public Sub SetRowFilter(rowFilter As String)
    Dim setting As DataViewSetting = _dataView.DataViewManager.DataViewSettings(_dataView.Table.TableName)
    If [String].IsNullOrEmpty(rowFilter) Then
        setting.RowFilter = _savedRowFilter
    Else
        _savedRowFilter = setting.RowFilter

        ' convert row filter format to col='val'. Input is col=val. 
        Dim parts As String() = rowFilter.Split("="C)
        Dim converted As String = parts(0) + "='" + parts(1) + "'"

        _dataView.RowFilter = converted
        setting.RowFilter = converted
    End If
End Sub
Requirements

Platforms: Windows 7 SP1 - Windows 10 Version 1909, Windows Server 2008 R2 - 2019

See Also

Reference

ITable Interface
ITable Members