Leveraging the MVC Grid to quickly display sortable, paging data.
MVC provides robust data controls for displaying data sets.
These grids come with many customizable features and require very little coding.
To illustrate this feature, I’ll begin a Model for Sales Associates.
Next, I’ll create a Controller which seeds a collection with several new sales associates.
All that’s left is to create a View to display my Grid.
Notice how little code is needed to configure a grid for display.
All that I’ve done is instantiate a new grid, set the source to pull from my Model, set it to sort by the lname field, and display 4 records per page.
Upon executing the controller, I see all the records displayed in a grid which has sorting and paging capabilities.