asp.net mvc - Sorting is not working in mvc MVCGrid.net -


i'm using mvcgrid.net grid show data data base. problem sort option not working here 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") 

this old question, i'll tell helped me.

    columndefaults coldefauls = new columndefaults() {     enablesorting = true };  mvcgriddefinitiontable.add("stategrid", new mvcgridbuilder<state>(coldefauls)     .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") 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -