c# - Keep current page when sorting in @grid.GetHtml -


is there way to keep current page when sorting @grid.gethtml columns?

for have

public virtual actionresult users(int? page) {   var model = _context.users();   return view(model); } 

and html

@{  var grid = new webgrid(source: model,defaultsort: "lastactivity",rowsperpage: 20);   // force descending sort when no user specified sort present  if (request.querystring[grid.sortdirectionfieldname].isempty())  {     grid.sortdirection = sortdirection.descending;  }  } @if (model != null) {   @grid.gethtml(tablestyle:  .... 

thank you!

webgrid not have built-in solution this. you'll have create own way load current page during sort action.

here 1 possible way: http://forums.asp.net/post/4220540.aspx


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -