Clearing listbox

3 posts, 0 answers
  1. Laurensius
    Laurensius avatar
    17 posts
    Member since:
    Jan 2014

    Posted 27 Jan 2014 Link to this post

    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. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 27 Jan 2014 Link to this post

    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.
  3. DevCraft banner
  4. Laurensius
    Laurensius avatar
    17 posts
    Member since:
    Jan 2014

    Posted 03 Feb 2014 Link to this post

    yeah thank you it works
    sorry for late reply (working with other parts of my apps while waiting your reply) 
    :)
Back to Top