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. C#
  4. dropdownlist problem

dropdownlist problem

Scheduled Pinned Locked Moved C#
helpcsharpdatabase
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.
  • S Offline
    S Offline
    scottichrosaviakosmos
    wrote on last edited by
    #1

    first of all i would like to say that i am very new to programming and also to .net . now i have a problem. i have two dropdownlists: 1) dropdownlist 1- having 2 items ex: male and female 2) dropdownlist 2_ having 4 items ex: dog, cat, fish, cow. now the problem is : if i select male then all the four options should be visible , but if i select female then dog, cat and cow will be visible but not fish. please send me the code both by help if items are hardcoded by itemlist and if we want to manipulate through database(sqlserver 2000). please help me , and reply me fast. thank you

    C S 2 Replies Last reply
    0
    • S scottichrosaviakosmos

      first of all i would like to say that i am very new to programming and also to .net . now i have a problem. i have two dropdownlists: 1) dropdownlist 1- having 2 items ex: male and female 2) dropdownlist 2_ having 4 items ex: dog, cat, fish, cow. now the problem is : if i select male then all the four options should be visible , but if i select female then dog, cat and cow will be visible but not fish. please send me the code both by help if items are hardcoded by itemlist and if we want to manipulate through database(sqlserver 2000). please help me , and reply me fast. thank you

      C Offline
      C Offline
      carbon_golem
      wrote on last edited by
      #2

      As fast as I could, it might not compile tho...

      HAI
      CAN HAS STDIO?
      I HAS A dropdown1 ITZ ARRAY
      I HAS A dropdown2 ITZ ARRAY

      BTW array assignments
      LOL dog IN MAH dropdown2
      LOL cat IN MAH dropdown2
      LOL cow IN MAH dropdown2

      I HAS A gender IN MAH dropdown1 ITZ YARN
      GIMMEH gender
      IZ gender LIEK "male"?
      YARLY
      BTW the male case
      LOL fish IN MAH dropdown2
      NOWAI
      BTW the female case, no other assignment necessary

      KTHX
      

      KTHXBYE

      “It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.” -Edsger Dijkstra

      1 Reply Last reply
      0
      • S scottichrosaviakosmos

        first of all i would like to say that i am very new to programming and also to .net . now i have a problem. i have two dropdownlists: 1) dropdownlist 1- having 2 items ex: male and female 2) dropdownlist 2_ having 4 items ex: dog, cat, fish, cow. now the problem is : if i select male then all the four options should be visible , but if i select female then dog, cat and cow will be visible but not fish. please send me the code both by help if items are hardcoded by itemlist and if we want to manipulate through database(sqlserver 2000). please help me , and reply me fast. thank you

        S Offline
        S Offline
        Shuaib wasif khan
        wrote on last edited by
        #3

        if(Listbox1.Text=="Female") { Listbox2.Items.Clear(); ListBox2.Items.Add("dog"); ListBox2.Items.Add("cat"); ListBox2.Items.Add("cow"); } else if(Listbox1.Text=="Male") { Listbox2.Items.Clear(); ListBox2.Items.Add("dog"); ListBox2.Items.Add("cat"); ListBox2.Items.Add("fish"); ListBox2.Items.Add("cow"); }

        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