Examples of sequencing, paging, and multiple recordings, paging, and multiple strips (not available)

zhaozj2021-02-11  202

.Net production with sorting, pagination and an example of the many records to select and delete: Lo Date: 2003-11-04 Contact: robert_luoqing@hotmail.com I. Overview Second, the realization of the functions of three constraints four principles Figure 5. Production process (example) six, original code 1, overview: DataGrid is often used in web applications, but the DataGrid control itself is sorted by the arch, paging function for a large number of records, according to its practice It is unrealistic, such as a table has 200,000 records, according to the sorting of DataGrid itself, the principle of paging, you must retrieve all records, and make a paging, which is a challenge for the server's memory and response. This thesis provides such a solution that onlys the response time is greatly improved only from the database, so the response time is greatly improved, and the memory overhead can be reduced. Second, the implementation function: 1. Display the data retrieved from the database on the page on the page (displays the DataGrid control). 2. Pipeting the record (you must make paging within the database, that is, the number of records per page, the number per page) 3, record the recording of the pilot page) 3. After clicking the DataGrid header to achieve the reordering display, There is a click to order in descending order, click on the second time (not sorting the displayed record, but re-reaching the criterion in the database and sorted by specified order) 4, you can click DataGrid Checkbox box to implement all-elective and full-selection functions, support group operations (such as delete, transfer, etc.), restricting the conditions 1, the database table must have a key field or have a unique field. Fourth, Schematic: Function 2: Function 3: Function 4: V. Production Process (Sample): 1, Database Structure: This example is the database northwind with SQL Server as an example, Table as Customers 2, encoding process: 1 The interface is as follows 2, the code is written: 1. First, the user will add a form. 2. Place a five LinkButton control on the form, and set the ID to: lkbdel, linkbuttonpreview, linkbuttonnext, linkbuttonlast, linkbuttonfirst, setting each control's text property is: "Delete", "Home", "Previous", "Next", and "Last", place the location as shown above; simultaneously put a DataGrid control on the form, the name of the control is: DGList 3, set the DGList control to true, the AutoGenarateColumes property is set to False The DataKeyField property is set to Customerid. The Width property is set to 100%, and the columns of setting the DGList control are as follows:

One of the first columns is necessary, other columns can increase or delete themselves according to the situation. In the upper code, the selection of CHECKBOX in the upper code implements all the selection or all-in-one functions of all display items are implemented by a JavaScript's Checkallorno (this) letter, and the specific function body is as follows: