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: