New to Telerik UI for WPF? Download free 30-day trial

In Code Behind

This tutorial will walk you through the common tasks of adding and removing RadListBoxItems programmatically.

Example 1: RadListBox without Items

<telerik:RadListBox x:Name="radListBox" Width="200">             

Adding RadListBoxItems

In order to add items to a RadListBox, you can create new RadListBoxItems and add them to the Items collection of the control.

Example 2: Populating RadListBox with items from code-behind

public MainWindow() 
    var item1 = new RadListBoxItem() { Content = "Australia" }; 
    var item2 = new RadListBoxItem() { Content = "Brazil" }; 

Figure 1: RadListBox populated in code

radlistbox populatingwithdata incodebehind

Removing RadListBoxItems

In order to remove a specific RadListBoxItem, you should remove it from the RadListBox's Items collection.

Example 3: Removing RadListBoxItems

private void RemoveFirstItem() 

See Also

In this article