MVC: Grid

Please see my other MVC articles.

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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s