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. RadioButton in GridView

RadioButton in GridView

Scheduled Pinned Locked Moved ASP.NET
4 Posts 4 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.
  • N Offline
    N Offline
    NET India
    wrote on last edited by
    #1

    Hello Friends, I want to have radiobutton in GridView. But only one RadioButton must be selected and also as i select a radiobutton then that row's id should be displayed

    A K R 3 Replies Last reply
    0
    • N NET India

      Hello Friends, I want to have radiobutton in GridView. But only one RadioButton must be selected and also as i select a radiobutton then that row's id should be displayed

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      Use Gridview Template Field.

      cheers, Abhijit CodeProject MVP

      1 Reply Last reply
      0
      • N NET India

        Hello Friends, I want to have radiobutton in GridView. But only one RadioButton must be selected and also as i select a radiobutton then that row's id should be displayed

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

        HI, Use Templatecolumns for placing radio buttons in gridview and after that by using javascript or server side code you can hide/visble the rows ...

        1 Reply Last reply
        0
        • N NET India

          Hello Friends, I want to have radiobutton in GridView. But only one RadioButton must be selected and also as i select a radiobutton then that row's id should be displayed

          R Offline
          R Offline
          Ravindra Bisen
          wrote on last edited by
          #4

          use the following code into tag of your gridview sel() is a js function you can use code of selecting current row function sel(srcElement) { alert('Ok'); var cb = event.srcElement; var curElement = cb; while (curElement && !(curElement.tagName == "TR")) { curElement = curElement.parentElement; } if (!(curElement == cb) && (cb.name != "cbxSelectAll")) { if (cb.checked) { curElement.style.backgroundColor = "gold"; rowsSelected = rowsSelected + 1; } else { curElement.style.backgroundColor = "white"; rowsSelected = rowsSelected - 1; } } }

          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