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. Problem with Enum and dropdownlist

Problem with Enum and dropdownlist

Scheduled Pinned Locked Moved ASP.NET
helpquestiondatabasedockerdata-structures
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.
  • A Offline
    A Offline
    AndyASPVB
    wrote on last edited by
    #1

    Hi I have a dropdown list, and the values displayed in this come from an enum, which on load of the page I cast to an array and then bind to the dropdown list. The dropdown list is itself part of a details view. When the user selects a value this selected value is saved to the database via an object, which has a property of that enum type. The object is bound using Microsoft Object Container Data Source for the rest of the details view, but of course the dropdown list is bound using the array. However, where am I stuck is when the user wants to edit a record, of course I want to show this record in the details view. Now I can show all the other fields in the detailsview using the Object Container Data Source, which also includes the value that the user selected from the drop down list when the record was entered. How do I set the drop down list to a value from the Object Container Data Source where the drop down list is bound to an enum/array? Thanks

    L 1 Reply Last reply
    0
    • A AndyASPVB

      Hi I have a dropdown list, and the values displayed in this come from an enum, which on load of the page I cast to an array and then bind to the dropdown list. The dropdown list is itself part of a details view. When the user selects a value this selected value is saved to the database via an object, which has a property of that enum type. The object is bound using Microsoft Object Container Data Source for the rest of the details view, but of course the dropdown list is bound using the array. However, where am I stuck is when the user wants to edit a record, of course I want to show this record in the details view. Now I can show all the other fields in the detailsview using the Object Container Data Source, which also includes the value that the user selected from the drop down list when the record was entered. How do I set the drop down list to a value from the Object Container Data Source where the drop down list is bound to an enum/array? Thanks

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

      Can you provide code snippet for the same??

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

      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