I needed to give a name to a list, as well as implementing one or two useful methods in addition. So this is my program architecture:
public class A
{
public void Method1()
{
...
}
public override string ToString()
{
...
}
}
public class B : List<A>
{
public override string ToString()
{
...
}
public void Method2()
{
...
}
}
And then, in my mainform, I'm creating and instancing:
BindingList<B> MyList = new BindingList<B> MyList();
To use it with a CheckedListBox, I'm using:
MyListBox.DataSource = MyList;
And then when I'm adding a new element to MyList, I've got the wrong text in the CheckedListBox. Indeed, it shows just one string "(Collection)", even if I have more than one item in MyList What's wrong with my code?