Open RafaelLiendo2409 opened 5 years ago
I know this is an old "issue", but this might help someone.
You are changing case to lower, here: switch (options.SortColumnName.ToLower())
BUT, you test using mixed case, here: case "Sitio":
Either drop the ToLower() function, or use lowercase in your case statement.
Hi
I am trying to use this, but is not working the sorting. This is my code, I enabled sorting in both the grid and columns. Is there an error?. I do not see any error in the console browser. It just do not sort.
Code:
ColumnDefaults colDefaults = new ColumnDefaults() { EnableSorting = true };
MVCGridDefinitionTable.Add("SitiosL", new MVCGridBuilder(colDefaults)
.WithAuthorizationType(AuthorizationType.AllowAnonymous)
.AddColumns(cols =>
{
// Add your columns here
cols.Add("ID").WithSorting(false)
.WithValueExpression(i => i.ID.ToString()); // use the Value Expression to return the cell text for this column
cols.Add("Sitio").WithSorting(true)
.WithHeaderText("Sitio")
.WithValueExpression(i => i.Sitio);
cols.Add("TipoSitio").WithSorting(false)
.WithHeaderText("Tipo de Sitio")
.WithValueExpression(i => i.TipoSitio1.TipoSitio1);
);