Please help in sorting the below list --
var varSource = new BindingList
varSource.Add(new KeyValuePair
varSource.Add(new KeyValuePair
varSource.Add(new KeyValuePair
varSource.Add(new KeyValuePair
varSource.Add(new KeyValuePair
How do I sort the above list before binding it to a combo box so that the details are listed in ascending order in the combobox?
Please advise.
Thanks.
VulpesPosted Jan 18, 2012, 6:26 AM
sasikumarPosted Jan 18, 2012, 7:04 AM
sasikumarPosted Jan 18, 2012, 6:15 AM
Thanks for the response. But in the mean time, I just tried the below option and it worked.
var sortedSource = from col in varSource
orderby col.Value
select col;
combobox.datasource = sortedSource.tolist();
Thanks.
VulpesPosted Jan 18, 2012, 6:04 AM
http://msdn.microsoft.com/en-us/library/ms132727.aspx