Double-click to obtain the row information of the GridView control.

Source: Internet
Author: User

Some netizens asked the GridView control to obtain the information of the row to be clicked, whether it is onclick or ondblclick.
The technical difficulty is to register a click or double-click event for the row of the GridView. Let's look at the example:
Create data in the database or on the webpage. On the site, create a webpage and add a GridView control to the webpage:


Now, we can bind data to the GridView Control Using. aspx. cs:


Before writing the OnSelectedIndexChanging = "GridViewFruit_SelectedIndexChanging" event of the Gridview, we first write the table that stores the selected information:



This table is generated at runtime as follows:


Now you can write OnSelectedIndexChanging = "GridViewFruit_SelectedIndexChanging" event:


The following is the important part, that is, registering a click event for the GridView or double-clicking the event. In the. aspx. cs code page, the override render method:




Animation demonstration:


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.