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. Using DataBinding with a user control

Using DataBinding with a user control

Scheduled Pinned Locked Moved C#
wpfwcfhelpquestionannouncement
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.
  • B Offline
    B Offline
    Brett Slaski
    wrote on last edited by
    #1

    I created a user control which contains a combobox for table lookups. It basically sets up a DataAdapter and DataSet and binds it to the combobox. For access to the SelectedValue from forms that will use the control I added: public object selectedValue { get { return this.combo.SelectedValue; } set { this.combo.SelectedValue = value; } } The problem that I am having is when I add the user control to form and use simple binding on the property selectedValue, the value isn't updated. It will update if I set it directly. See below. Works (from a new form) this.comboSelector.selectedValue = 100; // The comboSelector will update with the corrisponding data. Not Working (from a new form) this.comboSelector.DataBindings.Add(new System.Windows.Binding("selectedValue", dataSet, "table.column")); I also tried: this.comboSelector.DataBindings.Add("selectedValue", dataSet, "table.column")); When the Currency Manager's postion is chaged these values are not updated. What am I missing? Thanks in advance. Brett Slaski

    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