I want to create a list view from code behind so that I can control it's item collection through CAML easily (plus several conditions that would be much too hard to do in javascript). I tried using the ListViewByQuery control but filtering / sorting doesn't work. I tried a regular ListView which works as it should (although the page flashing as if it's doing a postback - even with an Update Panel) but there is no .Query property for refinement.

It's no trouble to spit out an asp gridview but I want all the bells and whistles of the new 2013 list views (sorting, filtering, paging, search etc), just with the ability to programmatically filter its items from code behind. What server control should I use to achieve this?

1 Answer 1


Try using SPGridView . It provides option to sort and filter just as Sharepoint list view webpart. Also you can add context menus in it.

  • Thanks Unnie...I've been playing with SPGridView but I think I'll be trying Datatable.net Commented May 27, 2014 at 17:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.