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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:39:32+00:00 2026-06-04T20:39:32+00:00

I want to have complex combobox with checkboxes, text, and may be a thumbnail.

  • 0

I want to have complex combobox with checkboxes, text, and may be a thumbnail. I have already looked at the following links which helped me alot while building complex comboboxes.

http://blogs.microsoft.co.il/blogs/justguy/archive/2009/01/19/wpf-combobox-with-checkboxes-as-items-it-will-even-update-on-the-fly.aspx

Looking for a WPF ComboBox with checkboxes

But, I can not find a way to consume these complex usercontol in my application. I am new to WPF, so any kind of demonstration support would be highly appreciated.

Dean, I was looking a solution of how to bind in code behind file with following example mentioned in an SO post earlier.

<ComboBox.ItemTemplate>
<DataTemplate>
    <StackPanel Orientation="Horizontal">
        <CheckBox IsChecked="{Binding IsSelected}"
                   Width="20" />
        <TextBlock Text="{Binding DayOfWeek}"
                   Width="100" />
    </StackPanel>
</DataTemplate>

So the question is, Do I need DataTable or something else to bind my list of Checkboxes and Titles with this combobox template?
Thanks in Advance

  • 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-04T20:39:34+00:00Added an answer on June 4, 2026 at 8:39 pm

    A Combobox is an ItemsControl. All ItemsControls can be filled “hardcoded” with items or containers.

    This adds a new entry in the combobox, and wrappes the string into an ItemsContainer, which is a ComboBoxItem.

    <ComboBox>
        <sys:string>Hello</string>
    <ComboBox>
    

    Here we create a combobox item directly, and add its content to a string with the value “Hello”

    <ComboBox>
        <ComboBoxItem Content="Hello"/>
    <ComboBox>
    

    Both look visually the same. Its important to understand that in the first case the ComboBox takes care of wrapping our, to the ComboBox unknown type string, into an ComboBoxItem, and uses a default DataTemplate to display it. The default DataTemplate will display a TextBlock and calls ToString() on the given data item.

    Now to have dynamic data, we need a ObservableCollection with our data items.

        class Employee
        {
            public BitmapSource Picture {get;set;}
            public string Name{get;set}
        }
    
    ObservableCollection<Employee> employees;
    myComboBox.ItemsSource = employees;
    

    We have a DataClass called Employee, an observable Collection which holds many of our dataitem, and set this collection as the ItemsSource. From this point on, our Combobox listens to changes to this collection. Like adding and removing Employees and automatically takes care of wrapping the new Employee into a ComboBoxItem. Everything is done automatically. The only thing we need to do is to provide a proper DataTemplate. The combobox doesn’t know how to “display” an employee and thats exactly what a DataTemplate is for.

    <DataTemplate x:Key="employeeTemplate">
        <StackPanel Orientation="Horizontal">
            <Image Source="{Binding Picture}"/>
            <TextBlock Text="{Binding Name}"/>
        </StackPanel>
    </DataTemplate>
    

    We know an employee is wrapped in a ComboBoxItem, and the ComboBoxItem uses a provided Datatemplate to display its data, which means that inside the DataTemplate we can use Binding to access all properties on the data item.

    Hope that helps you.

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

Sidebar

Related Questions

I have code written in c, which contains some complex algorithms and I want
I have a reasonably complex XML document which I want to flatten down to
I have a complex HTML form which I want to send via email. Is
I have a complex json array which I want to target a specific line/string
I have complex GUI application written in Python and wxPython. I want it to
I want to have a time series of 2x2 complex matrices,Ot, and I then
I have a very complex web app project I want to re-structure. Naturally, it
want to have a Hyperlink-Button in a gridView in which I can display a
I want to have a similar tool in Emacs as the following in Vim
I have complex UserControl (grid, edit controls for grid, etc...) and I want handle

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.