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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:23:16+00:00 2026-05-23T00:23:16+00:00

We regularly setup simple winforms using Linq To Sql. I recently discovered that the

  • 0

We regularly setup simple winforms using Linq To Sql. I recently discovered that the ComboBox control when used as a DropDownList only updates the underlying databinding when it’s clicked. So, if you tab into the control, hit the first letter to select your entry, then tab out. The underlying databinding never gets the new value. Linq set the binding property to the text value of ComboBox control as default.

The fix for this was to change the linq binding value (thanks to commenter RedDog for pointing that out).

So my question is this: How do I set Visual Studio to make ComboBox automatically set bindingsource as SelectedItem as opposed to Text when dragging from Linq to Sql datasource? Saves work, sure, but also keeps bugs from finding their way to customers.

  • 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-23T00:23:16+00:00Added an answer on May 23, 2026 at 12:23 am

    So, as per above, I believe you’ve resolved it by binding instead to SelectedItem and ensuring that DataSourceUpdateMode is set to OnPropertyChanged.

    However, with the rephrased question, you’ll find you can’t change the VS behaviour. You’ll have to make choices to what you bind to. There is a DefaultPropertyAttribute out there that at least some of the designer listens to but I don’t know if it works for binding.

    I’ll add that in our app we use a helper class to add all our bindings manually in code-behind rather than via the designer. This gives us a number of benefits including common behavioural “fixes” to all our bound controls. It also lets us use LINQ Expressions to resolve the property names and ensure that bindings are always to valid field names on the datasource – if setting bindings via the designer and then you delete a field in your schema then you won’t know about the problem until run-time.

    In the case of combo boxes our helper class had workarounds for:

    • Always set DataSourceUpdateMode to OnPropertyChanged
    • If bound to SelectedItem or SelectedValue:
      • Then add a binding Parse event handler to reset the bound value to the bound type’s default when SelectedIndex is -1
      • When data source is changed for the combo box after binding is added then reset the SelectedIndex of the combobox (note, had to do more special stuff when bound to SelectedValue for some reason)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to setup a batch job that monitor an SQL table regularly (let's
I am building a Setup Package using VS2008. This is a regular setup package
I am using a regular Visual Studio Setup Project to deploy my ASP.NET application.
I have a regular .NET Windows Forms treeview control. The nodes are setup like
I regularly achieve 100% coverage of libraries using TDD, but not always, and there
I re-image one of my machines regularly; and have a script that I run
I am trying to create a simple Android application that has a ActivityList of
The setup: I have a standard .php file (index.php) that contains two includes, one
I have a very simple setup: from distutils.core import setup setup(name='myscripts', description='my scripts', author='Ago',
I regularly want to check if an object has a member or not. An

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.