2014 Q2 - setting toggle state programmatically no longer fires ClientToggleStateChanged event

3 posts, 0 answers
  1. Joe Sugden
    Joe Sugden avatar
    52 posts
    Member since:
    Feb 2010

    Posted 23 Jul 2014 Link to this post

    var button = $find("<%= btnToggle.ClientID %>");
    button.set_selectedToggleStateIndex(0);

    This code used to fire the client ToggleStateChanged event, but now it no longer does - and I need it to.

    I can work around by calling the event code directly for now, except I won't have the proper eventArgs parameter to pass in.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jul 2014 in reply to Joe Sugden Link to this post

    Hi Joe Sugden,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" ButtonType="LinkButton" ToggleType="CustomToggle"
        OnClientToggleStateChanged="toggleStateChanged" AutoPostBack="false">
        <ToggleStates>
            <telerik:RadButtonToggleState Text="ToggleButton: Mute"></telerik:RadButtonToggleState>
            <telerik:RadButtonToggleState Text="ToggleButton: Low"></telerik:RadButtonToggleState>
            <telerik:RadButtonToggleState Text="ToggleButton: Medium"></telerik:RadButtonToggleState>
            <telerik:RadButtonToggleState Text="ToggleButton: High"></telerik:RadButtonToggleState>
        </ToggleStates>
    </telerik:RadButton>

    JavaScript:
    function toggleStateChanged(sender, args) {
        sender.set_selectedToggleStateIndex(2);
    }

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 24 Jul 2014 Link to this post

    Hello Joe,

    Thank you for bringing this problem to our attention.

    I have logged it into our database and we will do our best to have it fixed for one of the upcoming releases. You can follow the development of this bug in our feedback portal: http://feedback.telerik.com/Project/108/Feedback/Details/134398-fix-clientselectedtogglestatechanged-event-is-not-raised-when-executing-set-sele

    Unfortunately, I am not able to provide suitable workaround at this point, what I can suggest you is to manually call the event handler when calling set_selectedToggleStateIndex. Please excuse us for the inconvenience.

    As a small token of gratitude I have update your Telerik points.

    Regards,
    Dobromir
    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.

     
Back to Top