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. pass dropdown with 2 values

pass dropdown with 2 values

Scheduled Pinned Locked Moved C#
xml
2 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.
  • T Offline
    T Offline
    Tanuja123
    wrote on last edited by
    #1

    Using typeconverter i am having a dropdown.i want to pass Displayvalue for a dropdown as string value and its id as int value. E.g :- I have a dropdown called Fruit with 3 values(AAA,BBB,CCC). if i select AAA i want to pass value 0,if BBB value 1 etc.. All values are retrieved from XML file.Also no hardcoding is allowed . On propertyvalue changed event i get only display value (AAA,BBB,CCC) not id(0,1,2)...Tell me a solution to it.

    A 1 Reply Last reply
    0
    • T Tanuja123

      Using typeconverter i am having a dropdown.i want to pass Displayvalue for a dropdown as string value and its id as int value. E.g :- I have a dropdown called Fruit with 3 values(AAA,BBB,CCC). if i select AAA i want to pass value 0,if BBB value 1 etc.. All values are retrieved from XML file.Also no hardcoding is allowed . On propertyvalue changed event i get only display value (AAA,BBB,CCC) not id(0,1,2)...Tell me a solution to it.

      A Offline
      A Offline
      albCode
      wrote on last edited by
      #2

      On DataValueField property set values 0,1,2... On DataTextField property set values AAA,BBB,CCC...


      "My advice to you is to get married. If you find a good wife, you will be happy; if not, you will become a philosopher." Socrates

      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