Take the 2-minute tour ×  I'm data binding a list of pairs to a
drop down list, for some reason it's not working and I'm
intrigued.  The code I am using is :  public void
BindDropDown(List<Pair> dataList)     ddlGraphType.DataTextField
= "First";     ddlGraphType.DataValueField = "Second";
ddlGraphType.DataSource = dataList;  I'm getting this exception,
which is a lie!  DataBinding: 'System.Web.UI.Pair' does not
contain a property with the name 'First'.  Thanks in advance.
I know what the exception means, but a pair object does contain
the First and Second properties, that's where the problem lies.
share|improve this question  4 Answers 4  up vote 7 down vote
accepted  First and Second are Fields not properties of Pair
type. You need to create a class with two properties:   public
class NewPair     public string First { get; set; }     public
string Second { get; set; }  EDIT: Use of Tuple : suggested by
@Damien_The_Unbeliever & @Chris Chilvers  List<Tuple<string,
string>> list = new List<Tuple<string