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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:59:15+00:00 2026-05-25T12:59:15+00:00

I have a c# winforms app with a lot of different controls that are

  • 0

I have a c# winforms app with a lot of different controls that are bound (via bindingsource) to different properties of my business object (and this object implements INotifyPropertyChanged). When my user sets a certain control to a particular value, I need to change the value of another property (in code) and perhaps even disable the control that binds to that property. For example, I have a datetimepicker that maps to a datetime property. If my user enters a time value less than 00:10:00 (HH:MM:SS), I need to uncheck a checkbox (which is bound to a bool property). Currently, I have code in a validating event handler that looks at the value in the datetimepicker and if the .Hour == 0 and the .Minute < 10, I programatically set the value of the bool property (that the checkbox is bound to) equal to false. When I do this, the checkbox becomes unchecked, but the value in the datetimepicker reverts to what it was before the user entered the time that caused the boolean property to be set to false in the first place.

If I watch the value of the datetimepicker in the debugger, it gets reset as soon as this line of code executes:

businessObject.booleanVariable = false;

Do I need to do something to force the datetimepicker value back to the object property before I programatically set the boolean property to false?!? Or am I going about this all wrong? Is there some other way that bound controls which may impact other bound controls should be handled?

  • 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-25T12:59:15+00:00Added an answer on May 25, 2026 at 12:59 pm

    The Validating event fires before data is sent back to the bound object. Its purpose is to allow you to ensure that a control contains data that is valid according to business logic, and using it for handling ordinary (non-validation) logic will cause problems like you’re seeing.

    The best course of action would be to add code in the setter of your property that sets the bool property.

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

Sidebar

Related Questions

We have a WinForms app, written in VB.NET (CLR 2.0), that does a lot
I have a WinForms app that contains several comboboxes, numericupdown controls and checkboxes. I
I have a WinForms app that contains many NumericUpDown controls. In a nutshell, if
I have a winforms app that installs other apps in a loop. This works
I have a DataGridView in a WinForms 2.0 App that has a lot of
I have a winform app that fills a lot of its dropdomn fields fram
I have a winforms app that initially displays a window with two file dialog
I have a Winforms app that has a DataGridView that is databound at runtime.
I have a winforms app, that's locking up during a web service request I've
I have a winforms app that checks user credentials as it starts. If autharization

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.