Datalist in Dropdownbutton

2 posts, 0 answers
  1. OfficeHeart
    OfficeHeart avatar
    99 posts
    Member since:
    Aug 2008

    Posted 30 Aug 2010 Link to this post

    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>
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 31 Aug 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top