Get all items of RadListBox

3 posts, 2 answers
  1. Abhi Shinde
    Abhi Shinde avatar
    56 posts
    Member since:
    May 2010

    Posted 25 Jan 2012 Link to this post

    I am using RadListBox, I want to get all values of listbox.
    I am tying to use "get_items" method But it is showing foll. error.
    Uncaught TypeError: Object [object Object] has no method 'get_items' 
    ASPX code
    <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
     $('#<%=btnViewAssignedSlots.ClientID %>').click(function() {
                   var list = $('#<%= rdLstSource.ClientID %>');
                    var items = list.get_items();
                   var firstItem = items.getItem(0);

    <telerik:RadListBox runat="server" ID="rdLstSource" Height="200px" Width="230px"
                            AutoPostBackOnTransfer="false" AllowTransfer="true" TransferToID="rdLstDestination"
                            AllowTransferOnDoubleClick="true" EnableDragAndDrop="true" ButtonSettings-ShowTransferAll="true">
                                <telerik:RadListBoxItem Text="Sunday" Value="1" />
                                <telerik:RadListBoxItem Text="Monday" Value="2"/>
                                <telerik:RadListBoxItem Text="Tuesday" Value="3"/>
                                <telerik:RadListBoxItem Text="Wednesday" Value="4"/>
                                <telerik:RadListBoxItem Text="Thursday" Value="5"/>
                                <telerik:RadListBoxItem Text="Friday" Value="6"/>
                                <telerik:RadListBoxItem Text="Saturday" Value="7"/>

    Please help me to solve.
  2. Answer
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Jan 2012 Link to this post


    Try the following javascript.
    <script type="text/javascript">
        function OnClientClick()
            var list = $find("<%=RadListBox1.ClientID %>");
            for (i = 0; i < list.get_items().get_count(); i++)

  3. DevCraft R3 2016 release webinar banner
  4. Answer
    Bozhidar avatar
    1095 posts

    Posted 25 Jan 2012 Link to this post

    Hi Abhi,

    Please review the following help article, showing how to work with the RadListBox client object: 
    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top