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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:41:53+00:00 2026-06-14T19:41:53+00:00

I need to create a custom collection that implements IBindingList in order to be

  • 0

I need to create a custom collection that implements IBindingList in order to be able to bind it with a custom control from 3rd party. Another problem that I have is that I have to make that collection thread safe because I manually insert items from multiple threads simultaneously.

Anyways I am using a BindingList<T> as a field on my class in order to don’t reinvent the wheel to much. So my class looks like:

class ThreadSaveBindingCollection<T> : IEnumerable<T>, IBindingList
{
    BindingList<T> collection;
    object _lock = new object();

    // constructors
    public ThreadSaveBindingCollection(IEnumerable<T> initialCollection)
    {
        if (initialCollection == null)
            collection = new BindingList<T>();
        else                            
            collection = new BindingList<T>(new List<T>(initialCollection));                                 
    }
    public ThreadSaveBindingCollection() : this(null)
    {            
    }   

    // Todo: Implement interfaces using collection to do the work    
}

Note I am missing to implement the interface IEnumerable and IBinding list. I am planning for the field collection to take care of that as it implements those interfaces as well. So I let visual studio implement the interface explicitly and replace the throw new NotImplementedException() with the field collection implementation and I end up with something like:

enter image description here

Now the question is

Why I cannot call the method AddIndex on the field collection if collection claims to implement IBindingList!?

enter image description here

I am not able to do the same thing for several of the methods

  • 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-14T19:41:54+00:00Added an answer on June 14, 2026 at 7:41 pm

    It’s because it’s an explicit implementation of the interface, rather than implicit. This means you must call it through the interface rather than the type itself. For example:

    ((IBindingList)collection).AddIndex(property);
    

    See here for more information on explicit interface implementations.

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

Sidebar

Related Questions

I would like to create a custom WPF control that inherits from comboBox. So
Aloha, I have a custom control that I need to instantiate from within a
I need to create a custom Contains LINQ expression that derives from System.Linq.Expressions.Expression that
I have a custom object that implements INotifyPropertyChanged. I have a collection of these
I need to create a dependency property on a custom control. The problem is
I'm trying to create a T4 template which inherits from another one that is
I need create custom dialog and put JPanel into it. Is it possible?
Need to create a custom DNS name server using C which will check against
I need to create a custom user interface using extJS/JSP which will allow me
I need to create a custom json for the jit library. Should I use

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.