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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:10:05+00:00 2026-05-18T11:10:05+00:00

Well I was wondering how to bind a boolean property to a combobox.Combobox will

  • 0

Well I was wondering how to bind a boolean property to a combobox.Combobox will be a yes/no combobox.

  • 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-18T11:10:06+00:00Added an answer on May 18, 2026 at 11:10 am

    You could use a ValueConverter to convert the boolean value to a ComboBox index and back. Like this:

    public class BoolToIndexConverter : IValueConverter
        {
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                return ((bool)value == true) ? 0 : 1;   
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                return ((int)value == 0) ? true : false;
            }
        }
    }
    

    Assuming Yes is on index 0 and No on index 1. Then you’d have to use that converter in binding to the SelectedIndex property. For this, you declare your converter in your resources section:

      <Window.Resources>
        <local:BoolToIndexConverter x:Key="boolToIndexConverter" />
      </Window.Resources>
    

    Then you use it in your binding:

    <ComboBox SelectedIndex="{Binding YourBooleanProperty, Converter={StaticResource boolToIndexConverter}}"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

well i was wondering how will i enable javascript debugging because even after entering
I was wondering if OCaml will perform well in terms of performance and ease
i am new to web development. terrible at math as well i was wondering
I was wondering if there is a well C++ library that provides a file
Well, I am wondering about a thing with rounding decimals, and storing them in
Wondering if there are any well informed Linux gurus here who can answer a
I was wondering if position:fixed is working well in Microsoft browsers, before to start
I'm wondering if there are any existing (ideally well documented) PHP or Javascript/jQuery libraries/plugins
I am wondering what are the possible rich internet application solutions that goes well
Basically I'm wondering if anyone has any tips for ensuring your code is well

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.