---
title: "Add items to ComboBox at runtime?"  
description: "Add items to ComboBox at runtime?"  
author: "Royce Roy"  
published: 2014-04-10  
updated: 2014-04-11  
canonical: https://www.mindstick.com/forum/2014/add-items-to-combobox-at-runtime  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Add items to ComboBox at runtime?

I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to [add items](https://www.mindstick.com/forum/160381/how-to-add-items-to-a-list-collection-in-c-sharp) to a [ComboBox](https://www.mindstick.com/articles/57/display-record-according-to-combobox-selection-in-csharp-dot-net) (say Name="labelComboBox") at [runtime](https://www.mindstick.com/articles/52/creating-timer-at-runtime-in-c-sharp-dot-net) when I pressed an add [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) (say with Name="add2labels" Click="add2labels_Click"). But the ComboBox cannot show the [values](https://www.mindstick.com/forum/327/sum-textbox-values) I newly added. What did I miss?

The following is the [event handler](https://www.mindstick.com/forum/1371/c-sharp-dot-net-event-handler-delegate-question) for the add button:

```
private List<String> labels = new List<String>();... ...private void add2labels_Click(object sender, RoutedEventArgs e){   
labels.Add("new value");    labelComboBox.ItemsSource = labels;}
```

P.S. I am pretty sure the values were added to List<[String](https://www.mindstick.com/articles/1527/string-split-in-c-sharp)> labels correctly (its count did [increase](https://www.mindstick.com/articles/12959/are-you-struggling-to-increase-the-profit-of-your-liquor-store) each time).

## Replies

### Reply by Pravesh Singh

Hi Royce,\

Combobox has a display and value member to add values to combo-box you need to specify both.

Try this

```
ComboboxItem item = new ComboboxItem();item.Text = "new value";item.Value = 12;labels.Items.Add(item);
```


---

Original Source: https://www.mindstick.com/forum/2014/add-items-to-combobox-at-runtime

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
