This is a migrated thread and some comments may be shown as answers.

Find Item Control in RadListView Client Side

4 Answers 388 Views
ListView
This is a migrated thread and some comments may be shown as answers.
rahul
Top achievements
Rank 1
rahul asked on 09 Apr 2014, 07:00 AM
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

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Apr 2014, 04:19 AM
Hi Rahul,

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

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

Thanks,
Princy.
0
Eyup
Telerik team
answered on 14 Apr 2014, 09:03 AM
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.

 
0
BANDHAVI
Top achievements
Rank 1
answered on 29 Jun 2020, 07:08 PM

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.

0
Eyup
Telerik team
answered on 02 Jul 2020, 07:00 AM

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.
Tags
ListView
Asked by
rahul
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Eyup
Telerik team
BANDHAVI
Top achievements
Rank 1
Share this question
or