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. WPF
  4. Silverlight ComboBox Binding Issue [modified]

Silverlight ComboBox Binding Issue [modified]

Scheduled Pinned Locked Moved WPF
helpwpfcsharpjavawcf
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.
  • P Offline
    P Offline
    Programm3r
    wrote on last edited by
    #1

    Hi all, I am making use of a DataForm to display my data. I have made use of the DataForm edit template to customize the layout of the form. Data is returned and is being displayed within the DataForm. The problem is that, as soon as I start navigating (2 navigation clicks) with the DataFrom, only the ComboBox 'looses' it's binding on the SelectedItem (although it's selected item was data bound and then it just goes blank :confused:). The back end code consists of a generic list List and a string variable that has the value of each data item that is returned... public List<string> Category { get; set; } public string CategoryName { get; set; } ..
    The XAML code:... <dataFormToolkit:DataField DescriptionViewerPosition="Auto" LabelPosition="Left" LabelVisibility="Visible" Label="Category"> <ComboBox ItemsSource="{Binding Category}" SelectedItem="{Binding CategoryName, Mode=TwoWay}" /> </dataFormToolkit:DataField> ...
    Any reason why this is happening and how I can fix it? Many thanks in advance. Kind regards

    The only programmers that are better C# programmers, are those who look like this -> :bob:

    :java: Programm3r My Blog: ^_^

    modified on Wednesday, December 30, 2009 8:36 AM

    M 1 Reply Last reply
    0
    • P Programm3r

      Hi all, I am making use of a DataForm to display my data. I have made use of the DataForm edit template to customize the layout of the form. Data is returned and is being displayed within the DataForm. The problem is that, as soon as I start navigating (2 navigation clicks) with the DataFrom, only the ComboBox 'looses' it's binding on the SelectedItem (although it's selected item was data bound and then it just goes blank :confused:). The back end code consists of a generic list List and a string variable that has the value of each data item that is returned... public List<string> Category { get; set; } public string CategoryName { get; set; } ..
      The XAML code:... <dataFormToolkit:DataField DescriptionViewerPosition="Auto" LabelPosition="Left" LabelVisibility="Visible" Label="Category"> <ComboBox ItemsSource="{Binding Category}" SelectedItem="{Binding CategoryName, Mode=TwoWay}" /> </dataFormToolkit:DataField> ...
      Any reason why this is happening and how I can fix it? Many thanks in advance. Kind regards

      The only programmers that are better C# programmers, are those who look like this -> :bob:

      :java: Programm3r My Blog: ^_^

      modified on Wednesday, December 30, 2009 8:36 AM

      M Offline
      M Offline
      MikeGoatly
      wrote on last edited by
      #2

      Hey. This problem has been bugging me a lot lately - Something really odd is happening in the framework. What's happening is the data field control is modifying the bindings on the control and re-setting them. Setting the SelectedItem works fine, but when it comes to re-set the ItemsSource property the binding for the *SelectedItem* property *vanishes* without a trace. The only workaround I have at the moment is to make the ItemsSource binding TwoWay, and ensuring that the property it's bound to is read-only. This stops the code from modifying the ItemsSource binding. However, I'm now finding that the bindings are disappearing under other circumstances as well (it looks like it's happening occasionally when there is more than 1 combo box in the form) - I haven't solved that one yet. Cheers, Mike

      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