Question: I'd like to place dropdown (html select) to element with position: absolute, but the problem that when i push select to open menu it doesn't open. The button pushes but it doesn't open.

I have board (dive element) on on this board there are a lot of tiles (divs) with css like:

```
position:absolute
z-index: 2

```

And one of them contains chart library, called Highcharts. Highcharts container has z-index = 0

So it looks like

```
<div class='tile'> //position: absolute, z-index = 2
     <div class='highcharts-container'> //position: relative, z-index = 0
          <div class='controlPanel'>   //position:absolute, no z-index
              <button 1> //relative
              <button 2> //relative
              <wanna place here dropdown, so select> //!!!my dropdown
          </div>
     </div>
</div>

```

I tried to just put dropdown in div container with position relative, but without any result.

My code of addition:

```
 var chooseContainer = $('<div class="rangeContainer"></div>');
 var chooseRange = $('<select class="rangeDropdown"></select>');
 var element1 = $('<option value="volvo">Volvo</option>');
 var element2 = $('<option value="saab">Saab</option>');
 chooseContainer.append(chooseRange);
 chooseRange.append(element1);
 chooseRange.append(element2);
 chartControlPanel.append(chooseContainer);
 chartControlPanel.append(addBtn);
 chartControlPanel.append(resetBtn);
 chartControlPanel.append(legendBtn);

```

Edit (drawing of how it looks):
![dropdown problem](https://i.stack.imgur.com/mEXaq.png)

Thanks in advance! :)

JSfiddle:

<http://jsfiddle.net/akorovin/cq2be/>

Probably it's a problem with highcharts or with my css

Answer: 
Here is the culprit:

```
return obj.StartElevation.GetHashCode() ^
       obj.EndElevation.GetHashCode() ^
       obj.ListOfSections.GetHashCode(); // <<== This line

```

Lists do not base their hash code on the hash codes of their elements. Two different lists with identical element would not have the same hash code. Change this to a line that aggregates the hash codes of list members to make it work:

```
return 31*31*obj.StartElevation.GetHashCode() +
       31*obj.EndElevation.GetHashCode() +
       obj.ListOfSections.Aggregate((p, v) => 31*p + v.GetHashCode());

```

Note: Although this will make your code eliminate `cell3`, **your code would remain invalid**. The reason is not so obvious - the problem you will have is that your `Equals` method is not transitive, due to the fact that you compare doubles by allowing their differences be within a tolerance `0.001` to be considered equal. A consequence of this is that

```
Cell1 == Cell2 && Cell2 == Cell3

```

no longer imply that

```
Cell1 == Cell3

```

This is fundamentally wrong.

Moreover, it means that two objects that your algorithm considers equal may have different hash codes. The contract of the equality comparer prohibits this.

In order to fix this problem, switch away from representing elevations as `double`, and use `int` or `long` to store elevations expressed in units that are 1000 times smaller than the units that you currently have. In other words, if your code stores an elevation as a double `123.456`, the new code should store an integer `123456`. This would let you compare for equality with the right degree of tolerance. When you obtain the elevation for external use, cast the number to `double` and divide by 1000 to produce the old result.
Probably you need HasSet

Override GetHashCode and Equals method in your Column class

Add your objects to HashSet and you will get unique set.

for e.g. var columns = new HashSet(columnList); 

Below is the example using string

```
        public void ListToHashSet()
    {
        var list = new List<string> { "abc", "efg", "abc", "efg" };
        var set = new HashSet<string>(list);
        foreach (var item in list)
            Console.WriteLine("list:{0}", item);

        foreach (var item in set)
            Console.WriteLine("set:{0}", item);
    }

```

And check the output, as for .net string class already has override for GetHashCode and Equals you don't need to implement, but for custom class you will need to override both, Gethashcode for storing and retrieving from HashTable and GetEqual for equality of two object.