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

Datalist in Dropdownbutton

1 Answer 23 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
OfficeHeart
Top achievements
Rank 1
OfficeHeart asked on 30 Aug 2010, 08:35 AM
Hi,

Is use a DataList with checkboxes in a radtoolbardropdown button. I have got some problems with accessing the checkboxes via javascript (client side). If one is checked the rest should unchecked and visa versa.

Thanks,
Koen

<telerik:RadToolBar ID="RadToolBar1" runat="server" CssClass="toolbar" 
                OnButtonClick="onToolbarClick" 
                OnClientButtonClicking="OnCompanyToolbarClicking" Skin="Office2007">
                <collapseanimation duration="200" type="OutQuint" />
                <Items>
                    <telerik:RadToolBarDropDown runat="server" Text="Categorieen" >
                    <Buttons>
                    <telerik:RadToolBarButton runat="server" CssClass="customDDL" Value="CAT2">
                    <ItemTemplate>
                        <asp:DataList runat="server"  DataSourceID="odsCategorie" ID="DataList1">
                        <ItemTemplate>
                        <asp:CheckBox runat="server" ID="chk1" Checked="false" ValidationGroup='<%# Eval("id") %>' />  
                                <asp:Label runat="server" ID="Label1" AssociatedControlID="chk1" Text='<%# Eval("categorie") %>' />
                                 </ItemTemplate>
                                </asp:DataList>

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 31 Aug 2010, 01:50 PM
Hello Martin,

With your RadToolBar definition you can use the following jQuery code to access the checkboxes in the template:
<script type="text/javascript">
       function pageLoad() {
           var $ = $telerik.$;
           $(".customDDL input:checkbox").attr('checked', true);
       }
   </script>


All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ToolBar
Asked by
OfficeHeart
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or