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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T07:17:47+00:00 2026-05-15T07:17:47+00:00

I have a windows form (net 2.0) with controls on it bound to an

  • 0

I have a windows form (net 2.0) with controls on it bound to an entity (w/ INotifyPropertyChanged) through a BindingSource..works.

On the same form I have a drop down list that is also wired up through a BindingSource..works

Here’s a sample of the relevant code:

m_PlanItemLookupBindingSource.DataSource = GetBusinessLogic().RetrievePaymentPlanLookups(); // Collection of PaymentPlans
paymentPlanType.Properties.DataSource = m_PlanItemLookupBindingSource;
paymentPlanType.Properties.DisplayMember = "Name";
paymentPlanType.Properties.ValueMember = "ID";
paymentPlanType.DataBindings.Add(new Binding("EditValue", m_PlanBindingSource, "PaymentPlanID", true, DataSourceUpdateMode.OnPropertyChanged, null, "D"));

agencyComission.DataBindings.Add(new Binding("EditValue", m_PlanBindingSource, "AgencyCommission", true, DataSourceUpdateMode.OnPropertyChanged, null, "P1"));
billingType.DataBindings.Add(new Binding("Text", m_PlanBindingSource, "BillingType"));

So when I change a value in the drop down list I thought that the m_PlanItemLookupBindingSource Current property would change along with the PaymentPlanID property of the entity which does change.

Just a bit confused.

Thanks in advance,
Stephen

  • 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-15T07:17:48+00:00Added an answer on May 15, 2026 at 7:17 am

    The BindingSource takes the value in the control and sets it in the underlying source, which is the current object determined by the Position property of the BindingSource.

    So when you select a value in the drop down list, the PaymentPlanID property of the underlying object is set with the new value selected. The underlying object is identified by the Current property in the BindingSource.

    If you want to move the Current property to the object you select in the drop down list, you have to use the MoveFirst, MoveLast, MovePrevious or MoveNext methods or Position property on the BindingSource.

    As I see it, you can do the following: in the event handler of the Changed or ValueChanged event on the drop down list, you are getting the index of the selected item, which index you can pass to the BindingSource.Position property.

    Changed or ValueChanged event handler
        ...
        int index = DropDownList.ListIndex
        BindingSource.Position = index
        ...
    End event handler
    

    You should remove the DataBinding that links the drop down list’s sefrom the drop down list EditValue to the PaymentPlanID. This way the PaymentPlanId in the underlying object is not set to the selected value before the Position in the BindingSource is changed.

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

Sidebar

Related Questions

I have a pretty basic windows form app in .Net. All the code is
I have a simple .NET 2.0 windows form app that runs off of a
In .NET, Windows Forms have an event that fires before the Form is loaded
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
I have been developing a C# windows form application in XP. It all works
I have asp.net form that contains fields. When I access this window, my javascript
I'm using C# and I have windows form and web service... I have a
I have a Windows Form that takes quite a bit of time to load
I have a Windows Form app written in C#. Its job is to send
I have a windows form application that uses a Shared class to house all

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.