Exercise: Gridview of films, Oscar-winners coloured

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

The answer to the exercise will be included and explained if you attend the course listed below!

Category ==> ASP.NET webforms - C#  (25 exercises)
Topic ==> Gridview events  (3 exercises)
Level ==> Average difficulty
Course ==> ASP.NET webforms - C#
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Create a new website, and add in the files in the folder above.

Edit the web page frmFilms.aspx so that it shows all films winning Oscars in a different colour:

ASP.NET 4.0 - C# exercise - Gridview events (image 1)

Oscar-winning films appear in red font on a yellow background

Use a CSS class to keep the generated code tidy.

You can do this by intercepting the RowDataBound event.  Remember to check for each row first whether it is a data row, and be aware that some films have Null as their Oscar values.

Close this file down!

This page has 0 threads Add post