1
Reply

Sorting dictionary object

simona a

simona a

Jan 23 2009 1:10 AM
12.2k

Hi,

I've a dictionary object:

Dictionary<string, string[]> dictCompanies = new Dictionary<string, string[]>();

How do sort this object on its key?

I tried using OrderBy like below, but it does no seem to work

dictCompanies .OrderByDescending(c=> c.Key);

I'm binding this dictionary object to a checkboxlist in aspx page.

I tried sorting this ListItemCollection using delegate...but still no luck...

Am i missing something here?

Thanks

 


Answers (1)