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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:29:36+00:00 2026-05-16T22:29:36+00:00

I have a ComboBox (Windows Forms) that is bound to a List. It is

  • 0

I have a ComboBox (Windows Forms) that is bound to a List. It is created at design time. When the List contents are changed my code calls a function to refresh the data binding. This works fine for .NET 3.5:

BindingData.SuspendBinding();
DataSource = null;
DataSource = BindingData;
BindingData.ResumeBinding();

I have switched to .NET 4.0 and it has stopped working. Specifically after stepping through this code the VS debugger shows BindingData.DataSource refers to a list with 127 items, but the ComboBox Items property contains zero items.

See this SO question along a similar theme: ComboBox Items Count Doesn’t Match DataSource.

I have tried everything I can think of. Currently my code looks like the following and still doesn’t work:

BindingData.SuspendBinding();
DataSource = null;
DataSource = BindingData;
BindingData.ResumeBinding();
BindingContext Dummy = this.BindingContext;
Invalidate();
PerformLayout();

I tried switching from List to BindingList and that didn’t help. I had to switch from .NET 3.5 to .NET 4.0 against my will so this is pretty frustrating. I’m sure there is a specific sequence that works. Any ideas?

This is how I am attaching the data source to the ComboBox:

private BindingSource BindingData = new BindingSource();

BindingData.DataSource = Nodes;
DataSource = BindingData;

thanks, Andy

  • 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-16T22:29:37+00:00Added an answer on May 16, 2026 at 10:29 pm

    I solved it. I guess at some point I made what I thought was a minor change but actually wasn’t. This code was moved from being called when the ComboBox is being displayed to when it was being created. It didn’t yet have a handle and so the data binding cannot be refreshed.

    I added another refresh of the databinding again in a ComboBox.HandleCreated event and it works.

    thanks, Andy

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

Sidebar

Related Questions

I'd like to create a derived control from System.Windows.Forms.ComboBox that is bound to a
I have created a mutli-column combobox in VB.net 2008 using windows forms 2.0. I
I have a windows forms DataGridView that contains some DataGridViewComboBoxCell s that are bound
I have a System.Windows.Forms.ComboBox on a form and I want to capture the event
I have a data-bound combobox on a Windows form. When I select an item,
I am using a System.Windows.Forms.Combobox bound to Category table as search criteria. I need
In Visual Studio 2010, I have a windows forms application frmMain.cs with a ComboBox.
I have combobox in my windows forms app and I want it to have
I have UserControl which has two components public System.Windows.Forms.ComboBox innerComboBox; public System.Windows.Forms.TextBox innerTextBox; and
I have a simple Windows Forms application (with an Access database) with a combobox

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.