Find Item Control in RadListView Client Side

5 posts, 0 answers
  1. rahul
    rahul avatar
    27 posts
    Member since:
    Mar 2014

    Posted 09 Apr 2014 Link to this post

    Hi,

    I want to find a check_box_list controls check_box count in Rad_list_view on client side. how can get it.
    please provide solutions.
    My code as follows
    <telerik:RadListView runat="server"  ID="RadListView1" BorderColor="White" onitemdatabound="RadListView1_ItemDataBound" BorderStyle="None" AllowPaging="True">
            <ClientSettings></ClientSettings>          
             <ItemTemplate>
                        <div style="border-bottom:1px solid gray;padding-left:15px;">   
                              <table cellpadding="2px" cellspacing="2px" border="0">                                                                   
                                            <tr>                                                                    
                                            <td class="LabelWidth" style="margin-left:2%; vertical-align:middle;font-family: Georgia,serif;">
                                                     <asp:Label ID="Label4" runat="server" Text='<%# (DataBinder.Eval(Container.DataItem,"PermissionItemName")) %>'></asp:Label>
                                         </td>
                                                                          
                                         <td>    </td>
                                          <td valign="middle">
                                                 <asp:CheckBoxList  ID="Listbox_Permission" CellSpacing="10" CellPadding="5"  runat="server" RepeatDirection="Horizontal" CssClass="CheckboxList" AutoPostBack="false" >
                                                   </asp:CheckBoxList>        
                                                                              
                                           </td>
                                      </tr>                                        
                             </table>
                       </div>
                     </ItemTemplate>
                </telerik:RadListView>

    Thanks,
    Rahul
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Apr 2014 in reply to rahul Link to this post

    Hi Rahul,

    As a work around please try the following JavaScript to access the CheckBoxList.

    JavaScript:
    var CheckboxList = document.getElementsByClassName('CheckboxList');

    Thanks,
    Princy.
  3. Eyup
    Admin
    Eyup avatar
    4046 posts

    Posted 14 Apr 2014 Link to this post

    Hi Rahul,

    Alternatively, you can use the following approach:
    <ItemTemplate>
        <div ... id='<%# "ListViewItemDiv"+Container.DisplayIndex %>'>
    JavaScript:
    function buttonClick() {
        // accessing the checked values of the fifth item
        var index = 4;
        var itemEl = $get("ListViewItemDiv" + index);
        var checkBoxList = $telerik.findElement(itemEl, "Listbox_Permission");
        var checked = $(checkBoxList).find(":checked");
     
        // execute custom logic with the checked collection
        for (var i = 0; i < checked.length; i++) {
            alert(checked[i].value);
        }
    }

    Hope this helps.

    Regards,
    Eyup
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  4. BANDHAVI
    BANDHAVI avatar
    1 posts
    Member since:
    Jun 2020

    Posted 29 Jun 2020 in reply to Eyup Link to this post

    Hi , 

    I have a dropDown within the ListView .I need to update the Dropdown values based on the textbox in the listview . SO basically i need to load the dropdown with all the textbox values is in the list view.how can i get this.

  5. Eyup
    Admin
    Eyup avatar
    4046 posts

    Posted 02 Jul 2020 Link to this post

    Hello ,

     

    You can achieve this requirement following the approach mentioned here:
    https://www.telerik.com/support/kb/aspnet-ajax/listview/details/accessing-controls-in-listview

    I hope this will prove helpful.

     

    Regards,
    Eyup
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top