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

  • Home
  • SEARCH
  • 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 1015821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:27:28+00:00 2026-05-16T10:27:28+00:00

I have a ComboBox like this: <ComboBox IsEditable=True ItemsSource={Binding SelectableValues} SelectedValue={Binding SelectedValue} /> SelectableValues

  • 0

I have a ComboBox like this:

<ComboBox IsEditable="True" 
          ItemsSource="{Binding SelectableValues}"
          SelectedValue="{Binding SelectedValue}" />

SelectableValues is a list of double and SelectedValue is a double. If the user chooses a value from the list or manually enters one of those values, my SelectedValue property is updated. But if the user manually enters another value, it isn’t. How do I allow SelectedValue to take other values than those in ItemsSource?

Edit: Think of it like the font size box in MS Word. I can choose a value from the list, or provide my own value.

  • 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-16T10:27:28+00:00Added an answer on May 16, 2026 at 10:27 am

    Create a user control inheriting comboBox. Add a dependency property as ‘SelectedText’. create event handler for LostFocus on combo box, in event handler assign the entered value dependency property ‘SelectedText’.
    do binding on ‘SelectedText’, in its setter if value is new then ad to collection and set SelectedValue to new one.

    Indirectly you have to update source by adding new property in ComboBox.

    
      public class ExtendedComboBox : ComboBox
        {
            public ExtendedComboBox()
            {
                this.IsEditable = true;
                this.LostFocus += ComboBox_LostFocus;
            }
            public string SelectedText
            {
                get
                {
                    return (string)GetValue(SelectedTextProperty);
                }
                set
                {
                    SetValue(SelectedTextProperty, value);
                }
            }
    
            public static readonly DependencyProperty SelectedTextProperty = DependencyProperty.Register("SelectedText", typeof(string), typeof(ExtendedComboBox), new FrameworkPropertyMetadata(string.Empty, new PropertyChangedCallback(OnSelectedTextPropertyChanged)));
    
    
            private static void OnSelectedTextPropertyChanged(object sender, DependencyPropertyChangedEventArgs e)
            {
    
            }
    
            private void ComboBox_LostFocus(object sender, RoutedEventArgs e)
            {
                SelectedText = (e.Source as ComboBox).Text??string.Empty;
            }
    
        }
    
       // Binding Example
    
     %gt%local:ExtendedComboBox Margin="3" x:Name="ecb" SelectedText="{Binding SelectedText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemsSource="{Binding SelectedTextList}">%gt/local:ExtendedComboBox>
    
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use OUTER joins: SELECT b.id, COUNT(i.id) AS num_inspections, COUNT(v.id) AS… May 16, 2026 at 11:41 pm
  • Editorial Team
    Editorial Team added an answer No, sorry -- Android applications have no access to the… May 16, 2026 at 11:41 pm
  • Editorial Team
    Editorial Team added an answer I presume you mean the shell sample? (scons sample=shell). It… May 16, 2026 at 11:41 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a combobox in WPF like this: <ComboBox Text=Select Language... IsEditable=True IsReadOnly=True ItemsSource={Binding
Say I have a ComboBox , like so: <ComboBox IsEditable=True Height=30> <ComboBoxItem>robot</ComboBoxItem> <ComboBoxItem>Robot</ComboBoxItem> </ComboBox>
I have a wpf app with a combobox like this <ComboBox name=cmbBx1> <ComboBoxItem Name=Jan>January</ComboBoxItem>
I have a ComboBox that has its ItemsSource bound to a static List<CustomSettings> of
I would like to have a ComboBox control on a form which will be
I want to have a wpf combobox that displays the dropdown list box with
I have a simple class called Tuple. which looks like this : class tuple
i have generated a Linq to Sql class which looks like this. so i
I have a control derived from ComboBox , I want to use the ComboBox
I have a comboBox that displays different Municipalities (these Municipalities belongs to a particular

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.