Registering a custom filter
Name Surname Marital status Age Employed
Joe Crosswave Married 33 False
Merry Lisel Widowed 43
Henry Crux Single 30 True
Cody Jurut 51 False
Simon Scranton Single 35
Leena Laurent Divorced 21 False
Ode Cosmides Married 55 True
Diandra Mizner Single 22 False
Pete Cassel Married 24 False
Nicky Tremblay Married 33 True
Startup

MvcGrid.Filters.Register(typeof(Int32), "contains", typeof(NumberContainsFilter))

Filter

public class NumberContainsFilter : BaseGridFilter
{
    public override Expression Apply(Expression expression)
    {
        if (Values.Count == 0 || Values.Any(String.IsNullOrEmpty))
            return null;

        return base.Apply(expression);
    }

    protected override Expression Apply(Expression expression, String value)
    {
        Expression valueExpression = Expression.Constant(value.ToUpper());
        MethodInfo toStringMethod = typeof(Int32).GetMethod("ToString", new Type[0]);
        MethodInfo containsMethod = typeof(String).GetMethod("Contains", new[] { typeof(String) });

        Expression toString = Expression.Call(expression, toStringMethod);

        return Expression.Call(toString, containsMethod, valueExpression);
    }
}

Javascript

var ExtendedNumberFilter = (function (base) {
    MvcGridExtends(ExtendedNumberFilter, base);

    function ExtendedNumberFilter(column) {
        base.call(this, column);

        this.methods.unshift('contains');
    }

    return ExtendedNumberFilter;
})(MvcGridNumberFilter);

new MvcGrid(document.querySelector('.mvc-grid'), {
    filters: {
        'number': ExtendedNumberFilter
    }
});

MvcGrid.prototype.lang.number.contains = 'Contains';