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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:08:59+00:00 2026-05-31T06:08:59+00:00

I have several controls in a winform application that I added databindings to using

  • 0

I have several controls in a winform application that I added databindings to using code.

Dim tblWrapper As ObliqueQCAndSpliceTool.TableWrapper = New ObliqueQCAndSpliceTool.TableWrapper(tbl, idField.Name)
tblWrapper.UseCVDomains = True

bindSource = New BindingSource
bindSource.DataSource = tblWrapper
bindMgr = BindingContext(bindSource)

bindSource.SuspendBinding()

Dim idBinding As Binding = New Binding("Text", bindSource, idField.Name)
txtPointID.DataBindings.Add(idBinding)

Then I have other code that may automatically change values in these controls as the user moves through records in the list. I have had a request to add a simple button that will disable/re-enable editing for these controls. In other words, when enabled, the user or the program can edit the controls and the new values will be saved in the source dataset. When disabled, the controls should still show the values from the source dataset, but the user nor the program should be able to change those values.

I have looked into the AllowEdit property of both the BindingList (tablewrapper) and BindingSource objects that create the databindings, but have had not luck.

Is there a way to change all databindings to readonly without changing each control or resetting all the bindings?

UPDATE:

I tried the solution provided by @LarsTech, but due to some scope issues surrounding how the bindings were set up, I was unable to modify the update mode without recreating all the bindings. I decided it would be easier to simply disable all the code that programmatically changes the values in the controls and to disable all the controls when the button is set to disabled.

  • 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-31T06:09:01+00:00Added an answer on May 31, 2026 at 6:09 am

    Try specifying the DataSourceUpdateMode:

    Dim idBinding As New Binding("Text", bindSource, idField.Name, _
                                 False, DataSourceUpdateMode.Never)
    

    From DataSourceUpdateMode Enumeration:

    Never:
    Data source is never updated and values entered into the control are not parsed, validated or re-formatted.

    You can change this directly:

    idBinding.DataSourceUpdateMode = DataSourceUpdateMode.Never
    

    or

    idBinding.DataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several different user controls that get built dynamically and added to a
I have a Winform dialog that contains several user controls - all of them
I have a .NET 3.5 WinForms project that uses several 3rd party controls and
I have several server controls that implement the IValidator interface. As such, they have
I have a form with several textboxes and other controls. I'm using the errorprovider
I have a Form with several special controls on it that is the main
I have a WinForms app that contains several comboboxes, numericupdown controls and checkboxes. I
In my nib file I have several controls that I placed with xcode. Is
I have several controls on a page that contain the word DATE in the
I have a page and in that page i have several user controls, so

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.