Microsoft Developer
GridViews - basic exercise
Relatively easy

This Microsoft Developer GRIDVIEWS - BASIC exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl ASP.NET 2.0 USING VB course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Football teams - simple gridview, with optional skin

A full answer to this exercise is provided as part of the training course!

1) Download the files needed to start this exercise: exercise-789.zip (and click here if you experience any problems unzipping this file after downloading it).
2) Add the Access database in the above folder into your web site (right-click on the App_Data folder in Solution Explorer and choose Add Existing Item...).
3) Double-click on your database to edit it, then double-click on the Teams table to add your favourite team into the list.  Close down this table.
4) In Visual Studio, create a form called frmTeam.aspx.  Within this create a gridview to show the teams in your Access table to look something like this (please read notes below):
Exercise screen-shot 1638 Your gridview does not have to look like this - feel free to experiment
5) Here are some thoughts to help you!
  • The above gridview's AllowSorting property has been set to True
  • The gridview was autoformatted, and then the resulting lines of HTML were tweaked
  • The ItemStyle-ForeColor property of the first column has been changed
6) When your gridview looks as you would want it to, create a theme called Football, and within this theme screate a skin based on the settings that you have chosen.
7) Now create another page called frmPlayer.aspx which contains a gridview of players.  Without applying any additional formatting, apply your Football theme to this page.  Does your gridview now look pretty?  (It should).
8) Save and close any open files.

Thank you for showing an interest in this ASP.NET 2.0 using VB training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content copyright Wise Owl Business Solutions Ltd 2008.  All rights reserved..