Implementation of ArrayList and IBindingList

  • Thread starter Thread starter PeterB
  • Start date Start date
P

PeterB

Does anyone know of a good article or a full or partial implementation of a
class that inherits ArrayList and implements IBindingList. I am trying to
create a custom collection class that need to implement the IBindingList but
I am not familiar with how to do this.

thanks,

Peter
 
Yes I have looked (and still looking) at that example. I am unable to get
the ListChanged event to fire though. I added a button named "Add" which
used the current collection and added a new MyData object into it. The
datagrid was not updated with the new object....

I added a private member for the collection:
MyCollection m_collection;

I changed the constructor of Form1 to save the collection in the private
member:
m_collection = FakeData.GetData();
dataGrid1.DataSource = m_collection;

And I added a button which simply adds 1 object to the collection when
pressed:
private void btnAdd_Click(object sender, System.EventArgs e)
{
MyData ii = new MyData();
ii.ID = 10;
ii.FirstName = "Alex";
ii.LastName = "Yakhnin";

m_collection.Add(ii);
}

The example is not very explaining in the code, so I am still learning what
is going on there :-(

regards,

Peter
 
Back
Top