Select/deselect all items

4 posts, 0 answers
  1. spt
    spt avatar
    36 posts
    Member since:
    Sep 2007

    Posted 24 Dec 2009 Link to this post

    I want to add an icons to select/desect all items in the ListBox on the client side. Can you provide an example how to do this?
  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 25 Dec 2009 Link to this post

    Hello spt,

    What do you mean by Icons? Do you want custom buttons that look like the Transfer/Reorder buttons? Or just a button placed anywhere on the page that should select/deselect? I will prepare example as soon as you clarify your requirements. As for the implementation, here is sample code:

    function selectAll() {
                var listBox = $find("RadListBox1");        
                var count = listBox.get_items().get_count();
               
                for (var i = 0; i < count; i++) {
                    listBox.getItem(i).select();
                }
            }


    Sincerely yours,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. spt
    spt avatar
    36 posts
    Member since:
    Sep 2007

    Posted 25 Dec 2009 Link to this post

    I meant buttons looks like the Transfer/Reorder.
    I think you can include this feature in the next releases, it is very useful.
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1600 posts

    Posted 25 Dec 2009 Link to this post

    Hi spt,

    I have prepared sample project demonstrating how to add additinoal buttons for select/deselect all. I will log your suggestion and if there are more customers that require it, we will consider implementing it. You can find the sample as an attachment.

    Greetings,
    Genady Sergeev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top