New to Telerik UI for WinFormsStart a free 30-day trial

Adding items programmatically

Updated over 6 months ago

RadListControl supports adding items at run time, which means that you can manually populate it with data. The following example demonstrates how to add two different items to the RadListControl.Items collection.

You can use one of the following item types:

  • RadListDataItem – it represents a logical data item which can display specific text and image.

  • DescriptionTextListDataItem – similar to the RadListDataItem. In addition, it displays some description below the item’s text.

Figure 1: Sample RadListDataItem and DescriptionTextListDataItem

WinForms RadListControl Sample RadListDataItem and DescriptionTextListDataItem

Add items programmatically

C#
DescriptionTextListDataItem descriptionItem = new DescriptionTextListDataItem();
descriptionItem.Text = "Chicken wings";
descriptionItem.Image = Properties.Resources.chicken_wings;
descriptionItem.DescriptionText = "some description";
this.radListControl1.Items.Add(descriptionItem);
RadListDataItem dataItem = new RadListDataItem();
dataItem.Text = "Chicken toast";
dataItem.Image = Properties.Resources.chicken_toast;
this.radListControl1.Items.Add(dataItem);

See Also

In this article
See Also
Not finding the help you need?
Contact Support