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. ComboBox Databinding

ComboBox Databinding

Scheduled Pinned Locked Moved C#
wpfwcfhelpquestion
1 Posts 1 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.
  • D Offline
    D Offline
    Drew McGhie
    wrote on last edited by
    #1

    I have a typed dataset with an integer value called FiscalMonth. What I want to do is bind it to a combobox that is preseeded with a list of integers from 1-12. Here's what I have so far: for (int i = 1; i <= 12; i++) { uxcbFMonth.Items.Add(i); } mySource = new BindingSource(); mySource.DataSource = myManagerClient.VersionTable.Select("VersionKey = " +VersionKey.ToString())[0]; That seems to work just fine, the combobox is populated, and in the text fields, the databinding (using Control.DataBindings.Add) works. The problem is it doesn't appear as if the combobox databinding works, because when I try to change it the control locks and remains selected until I manually close the application. I assign the databindings like this: uxcbFMonth.DataBindings.Add("SelectedValue", mySource, "FiscalMonth", true, DataSourceUpdateMode.OnValidation); Am I binding to the wrong value? Any ideas?

    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