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. How to make row clickable DataGrid?

How to make row clickable DataGrid?

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
3 Posts 3 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.
  • K Offline
    K Offline
    kidus1
    wrote on last edited by
    #1

    Can any one help me in develing a row-clickable DataGrid control? thanks kidus

    C K 2 Replies Last reply
    0
    • K kidus1

      Can any one help me in develing a row-clickable DataGrid control? thanks kidus

      C Offline
      C Offline
      Chetan Ranpariya
      wrote on last edited by
      #2

      Hi, You want to execute any server code on click of the row in datagrid? If you want to use javascript then you can write follwing code in ItemDataBound event of Datagrid. if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItem.AlternatingItem) { e.Item.Attributes.Add("onclick", "urjavascriptfunction"); } I hope this will help you.

      Thanks and Regards, Chetan Ranpariya

      1 Reply Last reply
      0
      • K kidus1

        Can any one help me in develing a row-clickable DataGrid control? thanks kidus

        K Offline
        K Offline
        kumarjammula
        wrote on last edited by
        #3

        if (dgvEmployee.CurrentRow.Index == -1) // Is there any row selected now? return; // Retrieve the first column from the selected row. int Id = Convert.ToInt32(dgvEmployee.CurrentRow.Cells[0].Value.ToString()); This gives the particular value in the row of cell 0 ...If it help carry on

        came out of hardwork

        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