This is a migrated thread and some comments may be shown as answers.

Clearing listbox

2 Answers 71 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Laurensius
Top achievements
Rank 1
Laurensius asked on 27 Jan 2014, 10:24 AM
Hi, i want to know how to clearing the listbox? so when i click a button it will clear all item in listbox... can i do that?

2 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 27 Jan 2014, 01:29 PM
Hi Laurensius,
Thank you for contacting us. Yes, you can easily clear all items in a RadDataBoundListBox. Here's one way to achieve it:

radDataBoundListBox1.ItemsSource = null;

Another way is to clear the collection that is bound to the data bound list box:

List<string> items = new List<string>();
radDataBoundListBox1.ItemsSource = items;
 
items.Clear();

Let us know how it goes.

Regards,
Kiril Stanoev
TelerikIf you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Laurensius
Top achievements
Rank 1
answered on 03 Feb 2014, 10:48 AM
yeah thank you it works
sorry for late reply (working with other parts of my apps while waiting your reply) 
:)
Tags
DataBoundListBox
Asked by
Laurensius
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Laurensius
Top achievements
Rank 1
Share this question
or