Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6874011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:08:29+00:00 2026-05-27T04:08:29+00:00

Here is my ComboBox instantiated in the XAML <Combobox ItemsSource={Binding Path=Delimiters} DisplayMemberPath=Key SelectedValue={Binding Path=SelectedDelimiter,

  • 0

Here is my ComboBox instantiated in the XAML

<Combobox ItemsSource="{Binding Path=Delimiters}" DisplayMemberPath="Key"
          SelectedValue="{Binding Path=SelectedDelimiter, UpdateSourceTrigger=PropertyChanged}" />

Here is the corresponding bindings in the view model with the Dictionary populated in the constructor:

private IDictionary<string,string> _delimiters;

public IDictionary<string,string> Delimiters
{
   get{return _delimiters;}
   set{_delimiters = value;  RaisePropertyChanged("Delimiters");}
}

private KeyValuePair <string, string> _selectedDelimiter;
public KeyValuePair <string, string> SelectedDelimiter
{
    get{return _selectedDelimiter;}
    set{
       if(value.Key != _selectedDelimiter.Key || value.Value != _selectedDelimiter.Value)
       {
           var prevDelimiter = _selectedDelimiter;
           _selectedDelimiter = value;
           if(IllegalDelimiter.Contains(_selectedDelimiter)
           {
                 MessageBox.Show("errror", "error");
                 _selectedDelmiter = prevDelimiter;
           }
           RaisePropertyChanged("SelectedDelimiter");
       }

    }
}

I am having trouble with binding the selected value back. The Dictionary is getting bound and when I make a changed to the UI ComboBox, the setting is being fired correctly. In the if statement to check if its an illegal delimiter, it does set the selected value back to its original value in the code behind, but it doesn’t populate to the ComboBox UI (I see the get accessor firing from the UI). Its like setting SelectedValue doesn’t really do anything to the UI.

if someone could point me in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:08:30+00:00Added an answer on May 27, 2026 at 4:08 am

    Took a while to figure out, I was setting things correctly, but because I was updating the same property in the setter, I needed to use a dispatcher to create a new thread to do the update correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code: <ComboBox Grid.Column=1 Grid.Row=9 ItemsSource={Binding Path=PriorityEntries} SelectedItem={Binding Path=Priority,Mode=TwoWay}/> The comboBox is bound
Here is a snippet of my xaml: <ComboBox x:Name=cbo1 Width=100 SelectedValue=200> <ComboBoxItem Name=n1>100</ComboBoxItem> <ComboBoxItem
Here are my CollectionViewSources: <CollectionViewSource x:Key=topLevelAssysViewSource d:DesignSource={d:DesignInstance my:TopLevelAssy, CreateList=True} /> <CollectionViewSource x:Key=topLevelAssysRefPartNumsViewSource Source={Binding Path=RefPartNums,
Here is peace of the XAML code from my page: <ComboBox Grid.Row=2 Grid.Column=1 Name=Player2
ok, I must be having a brain freeze here... I have a ComboBox with
i'm trying hard to load comboBox items from an xml file. Here is my
I'm currently playing with the richfaces comboBox. You can check is here I would
Am working on smartphone application. Here I have a combobox which loads when the
Here is the code of jquery ui combobox with remote source. I need to
Here is my current jquery ui combobox. It uses remote datasource. Here is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.