Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Murach's ASP.NET 4.6 Web Programming with C# 2015, 6 edition Exercise 15-1. Pages 565-566 Chapter 15 How to use the Details View and FormView controls

Murach's ASP.NET 4.6 Web Programming with C# 2015, 6 edition

Exercise 15-1. Pages 565-566

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Chapter 15 How to use the Details View and FormView controls 565 Develop an application that uses a DetailsView control Exercise 15-1 In this exercise, you'll develop an application that lets the user select a customer from a Grid View control and maintain that customer in a Details View control To make that easier, you'll start from an application with a page that contains a GridView control that lists customers and valid that will be used to display error messages. ation summary and label controls Review the starting code for the application . Open the Ex15CustMaint Details View application in the aspnet46 cs directory 2. Review the aspx code for the SQL data source, and notice that it retrieves the Email, LastName, and FirstName columns from the Customers table 3. Display the page in Design view, and notice that only the LastName and FirstName columns are displayed in the Grid View control. That's because the Visible property of the Email column has been set to False. This column must be included in the data source, though, because it's the primary key of the Customers table, andl be used to display the selected customer in a Details View control 4. Run the application to see that you can page through the customers, but you can't select a customer Add a select function to the GridView control 5. Add a command field to the GridView control that will let the user select a customer. Add an ItemStyle element to this field that sets its width using the Bootstrap col-xs-l class. Run the application again and click the Select button for any customer. Notice how the formatting for the selected row changes. That's because a SelectedRowStyle element is included for the control 6. Add a default Details View control Chapter 15 How to use the Details View and FormView controls 565 Develop an application that uses a DetailsView control Exercise 15-1 In this exercise, you'll develop an application that lets the user select a customer from a Grid View control and maintain that customer in a Details View control To make that easier, you'll start from an application with a page that contains a GridView control that lists customers and valid that will be used to display error messages. ation summary and label controls Review the starting code for the application . Open the Ex15CustMaint Details View application in the aspnet46 cs directory 2. Review the aspx code for the SQL data source, and notice that it retrieves the Email, LastName, and FirstName columns from the Customers table 3. Display the page in Design view, and notice that only the LastName and FirstName columns are displayed in the Grid View control. That's because the Visible property of the Email column has been set to False. This column must be included in the data source, though, because it's the primary key of the Customers table, andl be used to display the selected customer in a Details View control 4. Run the application to see that you can page through the customers, but you can't select a customer Add a select function to the GridView control 5. Add a command field to the GridView control that will let the user select a customer. Add an ItemStyle element to this field that sets its width using the Bootstrap col-xs-l class. Run the application again and click the Select button for any customer. Notice how the formatting for the selected row changes. That's because a SelectedRowStyle element is included for the control 6. Add a default Details View control

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions