Dictionary ErrorDSDavid Smith10yAsked Jul 28, 2016, 6:52 PM817Visual Basic .NETI am trying to ordery by index and reset the dictionary by not re-iterating through the dictionary to set values again. So how can I achieve below. colorDictionary = colorDictionary [color.Key].OrderBy(f => f.Index);
Tapan Patel10y agoPosted Jul 29, 2016, 10:45 AMhere is how, you can rearrange the dictionary elements.Dictionary<int,string>sorted=dictionary.OrderBy(obj=>obj.Value).ToDictionary(i=>i.Key,j=>j.Value);
ATali tuncer10y agoPosted Jul 28, 2016, 10:13 PM do you want to sort values? I think this will work:colorDictionary = colorDictionary.OrderBy(x => x.Value).ToDictionary(x => x.Key, x => x.Value);
Tapan PatelPosted Jul 29, 2016, 10:45 AM
ali tuncerPosted Jul 28, 2016, 10:13 PM
do you want to sort values? I think this will work:
colorDictionary = colorDictionary.OrderBy(x => x.Value).ToDictionary(x => x.Key, x => x.Value);