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 8544623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:36:19+00:00 2026-06-11T12:36:19+00:00

In an application of mine, I’m using the WPF autocomplete box from the wpf

  • 0

In an application of mine, I’m using the WPF autocomplete box from the wpf toolkit. I’m implementing it via the MVVM pattern. The binding works fine, but I have a small problem when trying to clear the content of the autocompletebox. Setting the bound property in the viewmodel to null, clears the text only partially (all text entered via the keyboard is not cleared – i.e. if I enter CH when fetching all the cities and select Chicago and the set the bound property to null, the CH is not being cleared , the rest ICAGO is.)

The XAML looks like this:

           <my:AutoCompleteBox Grid.Row="0"
                                Grid.Column="1" 
                                HorizontalAlignment="Left" 
                                Margin="0,6,0,0" 
                                Name="acTown" 
                                SelectedItem="{Binding NewTown, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                ValueMemberBinding="{Binding Converter={StaticResource TownConverter}}"        
                                Populating="Populating"
                                VerticalAlignment="Top" 
                                Height="Auto" 
            </my:AutoCompleteBox>

The method in the viewmodel to clear the box is:

   public void ClearTown()
    {

    NewTown = null;

    OnPropertyChanged("NewTown");
}

I can’t figure out what’s wrong with the code, or is this just a bug in the autocompletebox?

After extensive research, I found this article: How do you clear the Silverlight AutoCompleteBox SearchText using MVVM, but it does not offer a solution. There seems to be a SearchText property on the AutoCompleteBox that is readonly and cannot have a setter

  • 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-06-11T12:36:20+00:00Added an answer on June 11, 2026 at 12:36 pm

    Finally got it. If anyone’s interested, the solution is to simply change NewTown = null to NewTown = new NewTown() in the ClearTown function.

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

Sidebar

Related Questions

I'm implementing Simplemodal in an application of mine using this code: $(.dialog-link).live('click', function(e) {
I thought about converting an application of mine from WPF 4 to Silverlight 4.
So I have this small application of mine I'm trying to deploy using visual
I'm using CMake to build a Qt based application of mine on Windows with
I'm using Direct3D to draw 2D elements in a C++ application of mine, and
I'm using the following code in an application of mine, and it's always used
I am getting very strange flickering on a WPF application of mine. It only
I'm using the STL string within an application of mine, and I was recently
I've been analyzing a WPF application which basically fetch data from a server and
I currently try to migrate an application of mine from datasets to EF4. So

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.