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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:51:03+00:00 2026-06-10T19:51:03+00:00

I am trying to figure out how to modify the state on a checkbox

  • 0

I am trying to figure out how to modify the state on a checkbox that is embedded in a ListView/GridView. The problem is that the checkbox is dependent upon the approval status of some records in a separate DataGrid. (eg. I am using the checkbox as an approval status True = all approved, False = none, null = some approved).

Since the DataContext is an Entity it doesn’t have a bool value that I could use to handle it.

<ListView x:Name="EmployeeNameListBox" Height="330" ItemsSource="{Binding}" SelectedValuePath="ID" SelectionChanged="EmployeeNameListBoxSelectionChanged">
    <ListView.View>
        <GridView AllowsColumnReorder="False" >                           
            <GridViewColumn>
        <GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <CheckBox IsThreeState="True" Checked="EmployeeCheckBoxChecked" Unchecked="EmployeeCheckBoxChecked" x:Name="CheckBoxHero"/>                                                  
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
            <GridViewColumn>
                <GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock>
                            <TextBlock.Text>
                                <MultiBinding StringFormat="{}{0}, {1} - {2}">
                                    <Binding Path="LastName" />
                                    <Binding Path="FirstName" />
                                    <Binding Path="EmployeeNumber" />
                                </MultiBinding>
                            </TextBlock.Text>
                        </TextBlock>
                    </DataTemplate>
                </GridViewColumn.CellTemplate>
            </GridViewColumn>
        </GridView>
    </ListView.View>
</ListView>

Here is where I’m trying to update the approval status:

foreach (var employee in this.employees)
{
    var records = from a in this.dailyActivities where a.Employee == employee select a;

    var approvedRecords = from r in records where r.IsApproved == true select r;

    if (approvedRecords.Count() == 0)
    {
        // None Approved checkbox state = false
    }
    else if (approvedRecords.Count() == records.Count())
    {
         // All Approved checkbox state = true
    }
    else
    {
         // Some Approved Set Checkbox state to null
    }                
}
  • 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-10T19:51:04+00:00Added an answer on June 10, 2026 at 7:51 pm

    Create a Nullable bool (bool?) wrapper property in your ViewModel class (I am assuming you are using MVVM pattern) and simply bind your checkbox with that property using RelativeSource.

    Put your logic in getter of that property –

    public bool? IsRecordApproved
    {
      get
      {
         .....
         // Your logic here
      }
    }
    

    And whenever you want the property to be updated on your UI, raise property changed event on your property. (INotifyProeprtyChanged event should be implemented by your ViewModel class)

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

Sidebar

Related Questions

I'm trying to figure out how to write a method that would modify the
I'm trying to figure out how to modify the Foursquare iOS API "BZFoursquare" found
I'm trying to figure out how to select, and then modify, the HTML within
I'm trying to figure out how to modify the default startup/deployment ordering of artifacts
I'm trying to figure out how moom can modify window of other applications. I
I'm trying to figure out how to add and modify badge icons to individual
I have this statement that im trying to figure out how to use in
I'm trying to figure out how to modify tap_example.py to get me a list
I am trying to figure out how to modify the width of the Google
I am trying to figure out which files I need to modify; so by

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.