Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want ListItems.ItemSource is clearly(delete old data) data before I click on button.
C#
private void btnSearching_Click(object sender, RoutedEventArgs e)  
      {ListItems.ItemSource=ResultofSearching(results[0],txtSearching.Text)};


E.g
On the first time it was clicked button then listitems will return that results
On the second time it was clicked button then listitems will be delete data on the first time and return newest data.
actually, I can clicked on button to on the third times. On the fourth times ,fifth...,listitems will not return anything, nothing...
I dont explain about that? Sorry.
Posted
Comments
[no name] 5-May-15 1:30am    
Jeff what exactly your problem is ? Do want to populate the list for the first time and then clear and fill it with the new data everytime the button is clicked ?

1 solution

clear the list every time you click the button
try
listitem.clear();
before you did the rest of the function. it will clear the list to empty everytime you click the button

sorry if this is not really what you want. if it isn't can you explain more?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900