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

RadListBox Items - Backgroundworker - ReportProgress

1 Answer 45 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 10 Sep 2014, 10:59 AM
Hi,

i add some Messages to a RadListBox in codebehind, using a Backgroundworker. If i start my application all ist fine.
But if i cklick on a button which starts the void again, i get all messages twice.

How can ein clear or remove all the items of my RadListBox before i start again?

radlistbos.Items.Clear(); - does not work

Or is there a  way to clear the Backgroundworker ReportProgress?

Thanks a lot
Best Regards
Rene

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 12 Sep 2014, 10:33 AM
Hi Rene,

In order to clear the Items from the RadListBox we can clear the ViewModel's collection that the RadListBox.ItemsSource is bound to. I've attached a sample project demonstrating this approach.

If the proposed way is not suitable for your scenario or it does not resolve the issue I would like to ask you for a project or code sample that demonstrates the problem in order for us to investigate and help you further.

Regards,
Polya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
ListBox
Asked by
ITA
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or