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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:24:10+00:00 2026-06-09T20:24:10+00:00

I have combobox with checkbox in data template. Combobox ItemSource property is binded with

  • 0

I have combobox with checkbox in data template. Combobox ItemSource property is binded with collection in ViewModel. I want to make one particular checkbox checked for default. How can I do this?

<ComboBox Grid.Column="1"
          ItemsSource="{Binding MyCollection, Mode=OneWay}" 
          Style="{StaticResource MyComboboxStyle}"
          Margin="5"
          MinWidth="120">
                <ComboBox.ItemTemplate>
                    <DataTemplate>            
                        <CheckBox Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext.MyCheckedCommand}"
                                  CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                                  Content="{Binding}"
                                  IsChecked="false"
                                  VerticalAlignment="Center"
                                  Margin="3"/>                    
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </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-06-09T20:24:12+00:00Added an answer on June 9, 2026 at 8:24 pm

    I would make a boolean property in your viewmodel then upon loading of collection, find the object in your collection that should be checked and set if to true.

     public bool IsChecked { get; set; }
    

    XAML:

      <CheckBox Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=DataContext.MyCheckedCommand}"
                                  CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                                  Content="{Binding}"
                                  IsChecked="{Binding IsChecked}"
                                  VerticalAlignment="Center"
                                  Margin="3"/>
    

    However this may require you to have this property apart of you object model

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

Sidebar

Related Questions

I have created ComboBox and CheckBox in a Form. Now what I want to
I have a combobox, and I want it to be enabled when checkbox is
I have a Form with multiple different controls like ComboBox , TextBox and CheckBox
I have a combobox whose value I want to use with a SQL WHERE
I have a combobox in a form and a button. I want to add
I have ComboBox that takes data from another class public partial class MainWindow :
I have a ComboBox and a TextBox and want to enable/disable TextBox only, when
I have a simple combobox with a checkbox inside as such: <ComboBox Height=23 HorizontalAlignment=Left
I have a combobox that I disable when user clicks on checkbox with this:
I have template for my ComboBox . taken from here . Lets say each

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.