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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:51:20+00:00 2026-06-06T19:51:20+00:00

I have some difficulties with understanding BindingSource’s behaviour. Let’s look at following example: Creating

  • 0

I have some difficulties with understanding BindingSource’s behaviour.
Let’s look at following example:

  1. Creating table

    DataTable dt = new DataTable();

    dt.Columns.Add("id", typeof(int));

    dt.Rows.Add(new object[] { 0 });

    dt.Rows.Add(new object[] { 1 });

    dt.Rows.Add(new object[] { 2 });

    dt.Rows.Add(new object[] { 3 });

  2. Creating two BindingSource objects with same DataSource property

    BindingSource bs1 = new BindingSource();

    BindingSource bs2 = new BindingSource();

    bs1.DataSource = dt;

    bs2.DataSource = dt;

At this point I supposed, that created BindingSource are fully independent. But really it is not so. After changing Filter property of bs1:

`bs1.Filter = "id >= 2";`

Filter property of bs2 doesn’t change, but RowFilter property of underlying DataView (List property of BindingSource) of both BindingSource objects is changed.

It turns out that both BindingSource objects have exactly same instance of DataView i.e. condition bs1.List == bs2.List is true.

My question is why they share same List and how one can change this behaviour?

EDIT:
I’ve found explanation for “why they’re sharing same List?” – it seems that List is assigned from DataTable‘s DefaultView property (so both bs1.List == bs2.List, bs1.List == dt.DefaultView are true).

  • 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-06-06T19:51:21+00:00Added an answer on June 6, 2026 at 7:51 pm

    It seems that to change this behaviour one can create two different DataView instances for DataTable and assign them to DataSource property of two BindingSource objects accordingly:

    BindingSource bs1 = new BindingSource();
    BindingSource bs2 = new BindingSource();
    bs1.DataSource = new DataView(dt);
    bs2.DataSource = new DataView(dt);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to WCF and I have some difficulties understanding certain things... I
I am new to programing and I have some difficulties getting AlertDialog working. I
I have some difficulties grasping some concepts. Grateful for help. Let's say you have
I am a new visual basic learner and I already have some difficulties in
I am pretty new to Wicket and i have some difficulties with using resource
I have some difficulties understanding how the access method Do not move cursor automatically
I have some difficulties understanding how Boost.MultiIndex is implemented. Lets say I have the
I have the following setup in my application and I'm having some difficulties passing
I have some difficulties in understanding if-then-else conditionals in regular expressions. After reading If-Then-Else
I am new to Haskell and have some difficulties wrapping my head around some

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.