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. General Programming
  3. .NET (Core and Framework)
  4. reading size using radio buttons

reading size using radio buttons

Scheduled Pinned Locked Moved .NET (Core and Framework)
database
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
    kolisa
    wrote on last edited by
    #1

    i wrote this code to retrieve size from the database private void grpSize_Enter(object sender, EventArgs e) { string size = ""; if (rdbLrg.Checked) { size = "Large"; } if (rdbReg.Checked) { size = "Reg"; } if (rdbSupa.Checked) { size = "Supa"; } i am using this to pass it to the next from frmOrderDetails order = new frmOrderDetails(lstItems.SelectedValue.ToString(),rdbSupa.Checked.ToString()); order.Show() but what it does shows me true when i click the size i want and show false when i click other button i want it to retrieve the size i putted on the database

    L T 2 Replies Last reply
    0
    • K kolisa

      i wrote this code to retrieve size from the database private void grpSize_Enter(object sender, EventArgs e) { string size = ""; if (rdbLrg.Checked) { size = "Large"; } if (rdbReg.Checked) { size = "Reg"; } if (rdbSupa.Checked) { size = "Supa"; } i am using this to pass it to the next from frmOrderDetails order = new frmOrderDetails(lstItems.SelectedValue.ToString(),rdbSupa.Checked.ToString()); order.Show() but what it does shows me true when i click the size i want and show false when i click other button i want it to retrieve the size i putted on the database

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      can you post code where you retrieve size from database based on the selection ??

      Jinal Desai - LIVE Experience is mother of sage....

      1 Reply Last reply
      0
      • K kolisa

        i wrote this code to retrieve size from the database private void grpSize_Enter(object sender, EventArgs e) { string size = ""; if (rdbLrg.Checked) { size = "Large"; } if (rdbReg.Checked) { size = "Reg"; } if (rdbSupa.Checked) { size = "Supa"; } i am using this to pass it to the next from frmOrderDetails order = new frmOrderDetails(lstItems.SelectedValue.ToString(),rdbSupa.Checked.ToString()); order.Show() but what it does shows me true when i click the size i want and show false when i click other button i want it to retrieve the size i putted on the database

        T Offline
        T Offline
        T M Gray
        wrote on last edited by
        #3

        Why are you passing the ToString of a boolean? That is asking for trouble. If all the radio buttons are in the same group you should add else before the 2nd and 3rd if statements. No reason to check for all 3 every time. I also don't understand why you wouldn't pass size to your second form.

        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