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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:52:37+00:00 2026-05-13T09:52:37+00:00

I am creating checked list box with the following template: <Style x:Key=CheckBoxListStyle TargetType={x:Type ListBox}>

  • 0

I am creating checked list box with the following template:

<Style x:Key="CheckBoxListStyle" TargetType="{x:Type ListBox}">
            <Setter Property="SelectionMode" Value="Multiple"></Setter>
            <Setter Property="ItemContainerStyle">
                <Setter.Value>
                    <Style TargetType="{x:Type ListBoxItem}" >
                        <Setter Property="Margin" Value="2" />
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <CheckBox IsChecked="{Binding Path=xxxxxxxxxxx,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay}">                                                                             <ContentPresenter></ContentPresenter>
                                    </CheckBox>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>

 <ListBox Style="{StaticResource CheckBoxListStyle}" ItemsSource="{Binding Path=Configuration.ProductTypes}" DisplayMemberPath="ProductName" />  

my problem is, i am getting all the product types from Database and binding it to the list box itemssource. i have a product class which contains a list of product types it belongs to. i need to set the IsChecked property of check boxes based on Product’s product type list. Typically i need to set one or more check boxes IsChecked property. product may belong to 1 or more product types. and selection mode is multiselect. if user checks the additional product type check boxes ..i need to get the total checked list boxes and save them to the database… this is a MVVM WPF application … any ideas on how to solve this scenario…
in the controltemplate what will be the path is IsChecked?

Thanks
Rey

Let me simplyfy my question: I need a list box with checkbox and textblock. textblock data context is different and check box data context is different. i mean they get their data from different objects. no idea how to achieve this…

  • 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-13T09:52:37+00:00Added an answer on May 13, 2026 at 9:52 am

    Let me simplyfy my question: I need a
    list box with checkbox and textblock.
    textblock data context is different
    and check box data context is
    different. i mean they get their data
    from different objects. no idea how to
    achieve this…

    Create a new class (a ViewModel) which contains the two data contexts (Model1 and Model2) and data bind to it, also known as the MVVM pattern.

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

Sidebar

Related Questions

No related questions found

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.