gridview row click (Data from Db in detail gridview)
-
I am having a gridview...data is coming from the database and is shown in gridview. Like, Employeeid, Employee name etc. So, Each row is showing an employee's id and his name. There is a view record button added in gridview using template field. When a user clicks on the button the complete record of the employee is shown in another gridview placed down it.
Now the requirement is , User should not need to click the view record button rather If he clicks anywhere on the gridview row the data should be displayed in the second gridview . So , the problem is i have to identify the click over the gridview row and then get data from database and show it in another gridview.
-
I am having a gridview...data is coming from the database and is shown in gridview. Like, Employeeid, Employee name etc. So, Each row is showing an employee's id and his name. There is a view record button added in gridview using template field. When a user clicks on the button the complete record of the employee is shown in another gridview placed down it.
Now the requirement is , User should not need to click the view record button rather If he clicks anywhere on the gridview row the data should be displayed in the second gridview . So , the problem is i have to identify the click over the gridview row and then get data from database and show it in another gridview.
You need to use
RowDataBound
of GridView and handle the click event of each row. Following article will give you some insight: Clickable and Double Clickable Rows with GridView and DataList Controls (ASP.NET 2.0)[^]Sandeep Mewara Microsoft ASP.NET MVP [My latest Article]: Server side Delimiters in ASP.NET[^]