J
John Grandy
Is it possible to bind a Dictionary to a DropDownList ?
The most obvious code fails :
Dictionary<string,string> dictionary = new Dictionary<string,string>
dictionary.Add("Name1","Value1");
//add some more items ...
DropDownList.DataSource = dictionary;
DropDownList.DataBind();
The dropdown displays items such as "[Name1,Value1]" , etc.
The most obvious code fails :
Dictionary<string,string> dictionary = new Dictionary<string,string>
dictionary.Add("Name1","Value1");
//add some more items ...
DropDownList.DataSource = dictionary;
DropDownList.DataBind();
The dropdown displays items such as "[Name1,Value1]" , etc.