creating a class which implements IBindingList and has objects, so that we can bind it to datagrid

Aug 3 2005 8:23 AM
Hi, I have written a small program which reads from objects included in an arraylist and populates the grid with their properties. The datasource to the grid is an arraylist which consists of a collection of structures (my structure has a target and source string) This is my code which goes into form load and will explain everything. // creating 2 objects myObj mo1 = new myObj(); myObj ms2 = new myObj(); mo1.source="this is my first source"; mo1.target="this is my first target"; mo2.source="this is my second source"; mo2.target="this is how i want my second target to look like"; I then add these objects to an arraylist. ArrayList list = new ArrayList(); list.Add(mo1); list.Add(mo2); I have set this arraylist as datasource to my grid. gridControl1.DataSource=list; Now, what i really want is to save the changes made in the grid back to the objects so that i can write them back to a file or something. but as my datasource is an arraylist i cannot save the changes to the objects contained in the arraylist. I have read and want to implement the IBindingList interface for my datasource. By doing this i will be able to use methods and save the changes made back to the objects. But, my problem is that i do not know how to implement this interface, i guess that i will have to make a new class which implements this interface and set it as datasource to the grid. But i dont have any clue how to do it. Can anyone please help me out on this. pllllllease. thanks a lot in advance, -- Nikhil