Arraylist bound to datagrid problem when arraylist is part of another class?
-
Hi! I have a class that looks like this: using System; using System.Collections; namespace AreaData { [Serializable()] public class Wrapper { ArrayList _Data = new ArrayList(); int _MovieLength = 0; public Wrapper() { } public Wrapper(ArrayList a, int l) { _Data = a; _MovieLength = l; } public ArrayList Data { get{return _Data;} } public int MovieLength { get{return _MovieLength;} set{_MovieLength = value;} } } } In my mainform I have a datagrid which is bound to the ArrayList of this class. Everything works fine, except when I try to change a value in the datagrid at runtime, then at first the change doesnt commit, and after that when I click somewhere else I get an error box: "Error when committing the row to the original data store" Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index. Do you want to correct the value? Everyting works fine, when the arraylist is located in the same class as the datagrid! Any solution to this would be really appreciated! thanks /Rickard