I have a BindingList<Pair<string,string>>
(where Pair
is just your bog standard generic to contain two related objects). I want to be able to bind this to a ListView
such that the .First
values is in column 1 and the .Second
value is in column 2. Further to this, how can I make sure the list view constantly represents the contents of the list, such that if I change one of the strings the ListView
automatically updates?
Here is my Pair<TI,TJ>
class for reference:
public class Pair<TI, TJ>
{
public TI First;
public TJ Second;
public Pair(TI first, TJ second)
{
First = first;
Second = second;
}
}
Just to clarify, a BindingList
is just the collection I'm currently trying to use, I can use any collection capable of supporting this functionality and holding Pair<string,string>
.