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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. A pair of radio buttons in a datagrid cell

A pair of radio buttons in a datagrid cell

Scheduled Pinned Locked Moved ASP.NET
csstutorialquestion
3 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.
  • B Offline
    B Offline
    beacon dartmouth
    wrote on last edited by
    #1

    How could I add a pair of radio buttons (w/ values YES and NO) in an edit (and add new) column of a data grid? I've seen samples that have one radio button per column to select it or de-select it (used a lot in surveys) but I haven't found yet an example where the user gets a pair in one column cell.

    M 1 Reply Last reply
    0
    • B beacon dartmouth

      How could I add a pair of radio buttons (w/ values YES and NO) in an edit (and add new) column of a data grid? I've seen samples that have one radio button per column to select it or de-select it (used a lot in surveys) but I haven't found yet an example where the user gets a pair in one column cell.

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi there. Use a <TemplateColumn> in your DataGrid; in the <TemplateColumn> add a asp:RadioButtonList control with Yes/No options.

      B 1 Reply Last reply
      0
      • M Mike Ellison

        Hi there. Use a <TemplateColumn> in your DataGrid; in the <TemplateColumn> add a asp:RadioButtonList control with Yes/No options.

        B Offline
        B Offline
        beacon dartmouth
        wrote on last edited by
        #3

        I've got your suggestion working fine. Thank you. The code behind now is the tricky part. I need to read into the radio button pair either a YES or a NO depending on the current value in the dataset, because at the moment none of the radio buttons are selected.

        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