mardi 26 janvier 2016

Sorting is not working in mvc MVCGrid.net

I'm using MVCGrid.net grid to show data from my data base. The problem is that sort option is not working Here is my MVCGrid code

       IEnumerable<State> st = null;
        MVCGridDefinitionTable.Add("StateGrid", new MVCGridBuilder<State>()
            .WithAuthorizationType(AuthorizationType.AllowAnonymous)
            .AddColumns(cols =>
            {
                cols.Add("StateCode").WithSorting(false)
                            .WithValueExpression(p => p.StateCode);
                cols.Add("StateName").WithHeaderText("State Name")
                    .WithValueExpression(p => p.StateName);                    
            })
            .WithSorting(true, "StateName")

Aucun commentaire:

Enregistrer un commentaire