Author Topic: SortedList - can't access to GetKey  (Read 2754 times)

0 Members and 1 Guest are viewing this topic.

latour_g

  • Newt
  • Posts: 184
SortedList - can't access to GetKey
« on: August 12, 2015, 01:38:35 PM »
I'm trying to get a key with the value of the index so I'm using acceXLS.GetKey(lb.SelectedIndex);
but I get the error :
'System.Collections.Generic.SortedList<int,int>' does not contain a definition for 'GetKey' and no extension method 'GetKey' accepting a first argument of type 'System.Collections.Generic.SortedList<int,int>' could be found (are you missing a using directive or an assembly reference?)

I don't understand why it's not working since it's working fine when I type it in the Watch Section when debugging (See attached image).

 :|

latour_g

  • Newt
  • Posts: 184
Re: SortedList - can't access to GetKey
« Reply #1 on: August 12, 2015, 02:03:50 PM »
I got it by using accesXLS.Keys[lb.SelectedIndex] instead of acceXLS.GetKey(lb.SelectedIndex);