Detailsview Control
Many applicationsProgramIt must act on a record at a time. In ASP. NET 1.X. It is possible to create a single record view, but you need to writeCode. First, you need to obtain the record, then bind the field to the data binding form, and select the paging button to browse the record. I have compiled three installation programs for the cutting edge column to solve this problem-April 2002, May and June.
When a master/Detail View is generated, the content of a single record is often displayed. Generally, you can select a master record from the grid to allow the application to trace all available fields. By combining the gridview and detailsview, you can write a small amount of code to generate a hierarchical view.
The user interface of the detailsview control can be customized by using data fields and types. The method is similar to that of the gridview. Detailsview does not support custom templates, because this special feature is fully constructed in the new formview control. Detailsview has a command bar that displays any combination of the edit, delete, and new buttons. When you click Edit or new, the control displays edit or insert mode, and the field content is displayed in the text box. The working mode can be controlled through the mode and defaultmode attributes.
The detailsview control can be used to implement a master/Detail View without code. In addition to the edit and delete buttons, The gridview control supports the select button, which is also predefined. You can enable this button for each row by setting the autogenerateselectbutton attribute to true. When you click this button, enter the selected status in the current row and assign the index value starting from 0 to the selectedindex attribute of the gridview. In addition, the gridview control triggers the selectedindexchanged event. Applications can hook up this event and execute custom code.
In ASP. NET 2.0, if you want to generate a master/Detail View, you do not need to process the selectedindexchanged event. You can drag a gridview control and a detailsview control to the page and bind the two to a data source.
Formview Control
Formview is a new data binding control, which is used as a template version of detailsview. It selects a record display from the relevant data source each time and provides a paging button to move between records. Unlike the detailsview control, formview does not use data control fields, but allows users to define the display of each project through a template. Formview supports any basic operations provided by its data source.
The formview control is designed as a commonly used update and insert interface. It cannot verify the data source architecture and does not support advanced editing functions, such as drop-down of foreign key fields. However, it is easy to use templates to provide this function. Formview and detailsview have two functional differences. First, the formview control has the itemtemplate, edititemtemplate, and insertitemtemplate attributes, but neither detailsview. Second, formview lacks the command line-toolbar for grouping available functions. Unlike the gridview and detailsview controls, formview does not have its own default display layout. At the same time, its graphical layout is completely customized by the template. Therefore, each template contains all the command buttons required for a specific record.
The BIND keyword is used to display data like eval and to retrieve input values when updating or inserting a record. In addition, BIND is very useful for templatefields used by gridview and detailsview.
Bind stores the property values of the bound control into a value set. The formview control automatically retrieves and uses this set to combine the list of parameters used to insert or edit commands. The parameter passed to bind must match the field name of the Data container. For example, the text box in the previous code snippet stores the value of the remarks field. Finally, remember that the edit and insert templates must contain buttons for saving changes. This is a common button-the update and insert used for saving and the cancel used to discard the operation.
These are just some simple things. I haven't studied them yet. I will introduce the detailsview and formview and Oracle Application Instances in detail in the next day .....