MVC: Customized 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.
I’ll start by instantiating 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.
Next, I’ll instantiating column objects for the columns I wish to display.
Also, I’ll configure the first column to provide a “Details” for each record.

3-mvc-customized-grid

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:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Connecting to %s