I have a condition that compares two integers, but it never returns true even tho both numbers will be equal.

```
foreach (TreeViewItem item in Categories.Items)
            {
                if (subCategory.Tag == item.Tag)
                {
                    item.Items.Add(subCategory);
                }
            }

```

both are properties of TreeviewItem

```
TreeViewItem catItem = new TreeViewItem();
catItem.Tag = (int)row["CategoryID"];
Categories.Items.Add(catItem);

```

And

```
TreeViewItem subCategory = new TreeViewItem();
subCategory.Tag = (int)row["CategoryID"];

```

Even tho both values will become equal, the condition will return false and won't reach `item.Items.Add(subCategory);`

does anyone know what i'm missing? 
both are of the same type (int)...
Thanks