private void listBoxItems_SelectedIndexChanged(object sender, EventArgs e) { var item = (listBoxItems.SelectedItem as Item); if (item == null) { return; } label_item_ammount.Text = item.AMMOUNT.ToString(); label_item_compartment.Text = inventory.getEntryById <Compartment>(item.COMPARTMENT_ID).ToString(); label_item_container.Text = inventory.getEntryById <Container>(item.CONTAINER_ID).ToString(); label_item_id.Text = item.ID.ToString(); label_item_name.Text = item.NAME; richTextBox_item_description.Text = item.ADD_DESCRIPTION; listBox_item_tags.Items.Clear(); foreach (var tag_id in item.TAG_IDs) { listBox_item_tags.Items.Add(inventory.getEntryById <TAG>(tag_id)); } }