add RadListBoxItem

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 24 Dec 2012 Link to this post

    Hi,

    I want to add a RadListBoxItem into a RadListBox from javascript.
     
    Can anybody help me to achieve this scenario ASAP?


    Thanks in advance

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 24 Dec 2012 Link to this post

    Hi,

    Try the following code to achieve your scenario.
    JS:
    function AddNewItem()
    {
               var lb = $find("<%= RadListBox1.ClientID %>");       
               var item = new Telerik.Web.UI.RadListBoxItem();
               item.set_text("New Item");
               lb.trackChanges();
               lb.get_items().add(item);
               item.select();
               lb.commitChanges();
      }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top