private void UpdateItem(IndentedComboBox.Item item, IndentedComboBox.Item selectedItem, ref int index) { foreach (IndentedComboBox.Item current in item.GetChildren()) { if (current == selectedItem) { index = this.comboBox.Items.Count; } this.comboBox.Items.Add(current); this.UpdateItem(current, selectedItem, ref index); } }