Client Events Help

2 posts, 0 answers
  1. Developer
    Developer avatar
    43 posts
    Member since:
    Apr 2014

    Posted 10 Aug 2015 Link to this post


    I have a RadTreeList cotrol. Within this is a TreeListTemplateColumn.
    Inside this I have two DIVs and radbutton configured as a custom toggle.  What I’d like to do is is when the user clicks the toggle button the system hides one div and shows the other.

    I’ve had a go at this with little success.  Here is the code for the buttons


    <telerik:RadButton ID="RadButton2" runat="server" ButtonType="LinkButton" Checked="True"
            Skin="Metro" ToggleType="CustomToggle" OnClientToggleStateChanged="SetVisibility"
                <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckboxChecked" Text="Existing" />
                <telerik:RadButtonToggleState PrimaryIconCssClass="rbToggleCheckbox" Text="New" />


    And here is the associated JavaScript:

                function SetVisibility(sender, args)
            switch (args.get_currentToggleState().get_text())
                case "Existing":
                case "New":
        function showstuff(boxid){
    function hidestuff(boxid){


    The problem with this is that is doesn't matter which button (row) within the treelist you click, the only DIVs that get changed are those within the first row.
    Any ideas how I can overcome this?

  2. Eyup
    Eyup avatar
    3320 posts

    Posted 12 Aug 2015 Link to this post


    You need to use runat="server" for the divs or define a unique ID depending on the item they are placed in. I've created a sample RadTreeList web site to demonstrate how you can achieve the requested functionality. Please run the attached application and let me know if it helps you.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top