Preview
Nom Nom de famille État matrimonial Âge Date de naissance Employé
Joe Crosswave Married 32 1/5/1992 False
Merry Lisel Widowed 42 5/6/1982
Henry Crux Single 30 11/19/1994 True
Cody Jurut 50 8/11/1974 False
Simon Scranton Single 35 10/10/1989
Leena Laurent Divorced 20 7/1/2004 False
Ode Cosmides Married 54 4/17/1970 True
Diandra Mizner Single 21 8/20/2003 False
Pete Cassel Married 23 3/13/2001 False
Nicky Tremblay Married 32 1/5/1992 True
Mary Cassel Married 25 7/10/1999 True
Startup

public void ConfigureServices(IServiceCollection services)
{
    services.AddMvcGrid(filters =>
    {
        filters.BooleanFalseOptionText = () => "faux";
        filters.BooleanTrueOptionText = () => "vrai";
        filters.BooleanEmptyOptionText = () => "";
    });
}

View

@model IQueryable<Person>

@(Html
    .Grid(Model)
    .Build(columns =>
    {
        columns.Add(model => model.Name).Titled("Nom");
        columns.Add(model => model.Surname).Titled("Nom de famille");
        columns.Add(model => model.MaritalStatus).Titled("État matrimonial");

        columns.Add(model => model.Age).Titled("Âge");
        columns.Add(model => model.Birthday).Titled("Date de naissance");
        columns.Add(model => model.IsWorking).Titled("Employé");
    })
    .Empty("Aucune donnée disponible")
    .Filterable(GridFilterType.Double)
    .Sortable()
)

Javascript

<script>
    MvcGrid.lang = {
        default: {
            "equals": "Egale",
            "not-equals": "Pas égal"
        },
        text: {
            "contains": "Contient",
            "equals": "Egale",
            "not-equals": "Pas égal",
            "starts-with": "Commence par",
            "ends-with": "Fini par"
        },
        number: {
            "equals": "Egale",
            "not-equals": "Pas égal",
            "less-than": "Inférieur à",
            "greater-than": "Supérieur à",
            "less-than-or-equal": "Inférieur ou égale à",
            "greater-than-o-requal": "Supérieur ou égale à"
        },
        date: {
            "equals": "Egale",
            "not-equals": "Pas égal",
            "earlier-than": "Inférieur à",
            "later-than": "Supérieur à",
            "earlier-than-or-equal": "Inférieur ou égale à",
            "later-than-or-equal": "Supérieur ou égale à"
        },
        guid: {
            "equals": "Egale",
            "not-equals": "Pas égal",
        },
        filter: {
            "apply": "",
            "remove": "✘"
        },
        operator: {
            "select": "",
            "and": "et",
            "or": "ou"
        }
    };
</script>