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

The Archive Base Latest Questions

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

I have a ComboBox which is binded with a List. Consider I have 10

  • 0

I have a ComboBox which is binded with a List. Consider I have 10 Items in the List, so in the combobox also.

Currently 2nd Item is selected in the ComboBox.

Now I am selecting the 3rd item in the ComboBox.

In the Combobox SelectionChanged event, I am doing some validation and validation fails so I don want my Selection is changed from 2nd item to 3rd item or the selection should remain in 2nd item.

Please let me know how to do this?

In the ComboBox SelectionChanged event, I tried to set ComboBox.SelectedItem = 2ndItem.

But this didn’t work properly.

Hope, my requirement is clear. If you have any doubt then please feel free to ask me.

regards,

Vimal

  • 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-16T20:23:28+00:00Added an answer on May 16, 2026 at 8:23 pm

    Disable the item so that the user sees that they are currently not an option (and also can not select). You can set the IsEnabled-property on the ComboBoxItem.

    If you work with MVVM, add an IsEnabled-property to your ViewModel and bind it on the IsEnabled-property of the container (ItemContainerStyle).

    The best option IMO would however be, not to show the items that are not selectable.

    Update

    As promised in a comment, here the Dispatcher-Code to set the SelectedItem delayed:

    Dispatcher.BeginInvoke(new Action(delegate {  
        yourComboBox.SelectedItem=yourOldItem;       
        }), System.Windows.Threading.DispatcherPriority.ContextIdle, null); 
    

    I think this will help, however it’s not very nice. If you have the possibility to disable or hide the items, this would be much better. BTW, I took ContextIdle for the dispatcher-priority. This is a very strong value. You can play around which value fits to your needs.

    CoerceValueCallback

    Another possibility would be to derive from Combobox, change the metadata for the SelectedItem and add a CoerceValueCallback to it. There in, you can reset the value.

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

Sidebar

Related Questions

I have binded a list of enum to a combobox. Now I want to
I have a simple webgrid which displays list. I also have a combobox which
I have a combobox from which i need to programmatically disable items depending on
I have a Dictionary which is binded to a combobox. I have used dictionary
I have a ComboBox with fairly complex template for individual items, which includes two
The problem is strange, I have a combobox which is correctly filled with items
Hi all I have a combobox which is databound to a list of elements.
i have a combobox which is displaying date from database...in my database the date
I have a combobox which is populated by the Keys enumeration (winforms). The problem
I have a datagridview and a combobox which get populated randomly with data. However,

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.