Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. gridview row click (Data from Db in detail gridview)

gridview row click (Data from Db in detail gridview)

Scheduled Pinned Locked Moved ASP.NET
databasehelp
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GSingh Developer
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • G GSingh Developer

      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.

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      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[^]

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups