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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:55:35+00:00 2026-05-23T10:55:35+00:00

This is the ListBox code: <ListBox x:Name=courseslistview ItemsSource={Binding .} FontSize=18.667 FontFamily=Trebuchet MS LayoutUpdated=courseslistview_LayoutUpdated> <ListBox.ItemTemplate>

  • 0

This is the ListBox code:

<ListBox x:Name="courseslistview" 
         ItemsSource="{Binding .}" 
         FontSize="18.667" 
         FontFamily="Trebuchet MS" 
         LayoutUpdated="courseslistview_LayoutUpdated">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <CheckBox Content="{Binding .}" />
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

How can I use C# to get all the checked checkboxes in the above ListBox?

  • 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-23T10:55:35+00:00Added an answer on May 23, 2026 at 10:55 am

    It would probably be best to bind the CheckBox to the IsSelected property of the ListBoxItem, like so:

    <DataTemplate>
        <CheckBox Content="{Binding .}" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" />
    </DataTemplate>
    

    Then you can get the checked/selected items from the ListBox.SelectedItems collection. You’d also have to set SelectionMode to Multiple.

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

Sidebar

Related Questions

This is how looks my listbox: <ListBox x:Name=ForthListBox Margin=0,0,-12,0 ItemsSource={Binding Tops} Tap=ForthListBox_Tap Style={StaticResource TopListBoxStyle}>
I can't figure this out, consider the following code: <ListBox Width=200 ItemsSource={Binding CurrentArticle.ArticleCategories} DisplayMemberPath={Binding
can someone give the C# equivalent of this xamle code? <ListBox Width=400 Margin=10 ItemsSource={Binding
So I have this Xaml inside a ListBox Item Template: <ListBox.ItemTemplate> <DataTemplate> <Grid Height=22
Hei, So lets assume that I have this ListBox.ItemTemplate: <phone:PhoneApplicationPage.Resources> <DataTemplate x:Key=DataTemplate1> <StackPanel Orientation=Horizontal>
I have this code in a xaml page: <ListBox Height=524 HorizontalAlignment=Left Margin=12,6,0,0 Name=listBox1 VerticalAlignment=Top
This is our code: <div> <table style=width: 349px> <tr> <td class=style1> <asp:ListBox ID=leftbox runat=server
I am trying to execute this code for a listbox but its not working,
In the aspx code view , we can code like this: <asp:ListBox runat=server> <asp:ListItem
[Original] I have a ListBox which has its ItemsSource (this is done in the

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.