Use the ASP + DataGrid control to create the master View/details view

Source: Internet
Author: User
Introduction
The next release of Microsoft & reg; Visual Studio. NET includes the DataGrid Web control (as part of the Server control's Active Server Page + (ASP +) suite ).
This control provides the HTML representation function based on the content of the data source.
The DataGrid control can be used for several read-only reports. This control is designed to simplify the output of a rich and fully customizable data table layout. It also provides multiple mechanisms for adding interactivity to the output through hyperlink and its support for selection, sorting, paging, in-situ editing, and other features. This makes the control useful in some common Web application solutions, such as list, shopping cart, and query results.
The DataGrid also provides some functions that feature all Server controls unique to the ASP + architecture. The control contains the logic required for browser-independent output. It also provides a unified programming model to process the returned data and manage the status between requests. In this way, developers can program object models with attributes, methods, and events without having to deal with the inconsistency and complexity caused by HTML programming.
Use ASP + list binding controls (English) to introduce the DataGrid control and related DataList and Repeater controls. It also introduces several key concepts such as data binding, template, and formatting. This article is written on this basis and focuses on the DataGrid control to reveal how to use the functions provided by the control in your own applications.
--------------------------------------------------------------------------------
What should we establish?
This document presents a series of sample pages that are combined to generate a page based on the Authors table and Titles table of the sample database, provides the master/detail View (this database is shipped along with Microsoft SQL Server & #8482; 2000 ). Each page in the sequence describes a new feature or function of the DataGrid control. The following images are extracted from the pubs database.
The master/detail view is similar to the form/subform concept introduced by Microsoft Access. It is also similar to the DataForm Wizard (data form Wizard) shipped with Microsoft Visual InterDev & reg; 6.0 ). The master/detail View displays the results of one to more links. One part of the view displays the results of the first query or master query. Then, we track a selection to filter the results of the second query used, and then display the details of the selected content in another part of the view.
Figure 1. Completed page
Figure 1 shows the Author list in the upper half of the page, and displays detailed information about the selected Author (including the relevant title) in the lower half.
The Authors list and Titles are both represented by the DataGrid control.
Show the author's DataGrid example to show how to select, sort, and pagination. The DataGrid that displays the title shows how to edit, format, and customize columns in situ.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.