First item in a SortedDictionary?
There are many, many threads on ways to get the "first" item from a Dictionary , and various answers as to why such a thing is not really a good idea because there's no internal ordering. But mine's a SortedDictionary , so those arguments don't apply. Yet I cannot find a way to get the Nth item from a SortedDictionary any easier than a Dictionary . Here is my SD: FRs As SortedDictionary(Of DateTime, ScheduleItem) I see a few hints that I should be able to do: If FRs.Count = 1 Then FirstFR = FRs.Keys(0) But that is not valid in my code - it says it has no defaults and cannot be indexed. .First