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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -