Diagram of ASP. NET Gridview (1)

Source: Internet
Author: User

A table control provides editing, sorting, and deletion functions. Two data binding methods are available: the DataSource attribute or the performanceid attribute (two-way data binding is supported)
 
 
Common Properties and descriptions of Gridview:

 
Common methods and descriptions of Gridview:

You must use the DataBind method when using the Gridview for data binding.
 
Common Gridview events and descriptions:

How to perform operations on the database without writing any code: (the database connected here is a database of the SQL Server Series)
Step 1:
Drag the Gridview and SqlDataSource controls to the. apsx design interface from the toolbox.

Step 2:
Click Configure data source in to display:

Click Create connection, configure the database to be connected, and click Next... Until the following page is displayed:
 

Select the table name and query condition to be operated, and click Next to view the test query. After the test query is successful, the corresponding data is displayed. If the query result is expected, click Finish.
Step 3:
Click the small button (as shown in <) in the upper-right corner of the Gridview control, as shown in the following figure:

After selecting the data source

To enable pagination, you only need to check enable pagination and specify the Pagesize value in the Gridview control attribute as the number of entries to be displayed on each page (10 by default ).
Step 4 (edit and delete)
 
Configure the data source again for the SqlDataSource control and go directly to the second image in step 2. Click "advanced ".

Select both of them (if both are optional, the data table requesting the operation does not have a primary key defined) and click OK.
Select, and then click Next.
Repeat Step 3 to see:

 
Select edit and delete.
 


From jory

Related Article

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.