Deselect

3 posts, 0 answers
  1. MD
    MD avatar
    55 posts
    Member since:
    Jul 2012

    Posted 21 Oct 2009 Link to this post

    What would be the easiest way client-side to have a panel bar item appear unselected after it is collapsed?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 22 Oct 2009 Link to this post

    Hello,

    I tried following code in order to deselect the item after collapsing. Give a try with this.

    JavaScript:
     
    <script type="text/javascript"
        var item; 
        function OnClientItemCollapse(sender, args) { 
            item = args.get_item(); 
            setTimeout("item.set_selected(false);", 100); 
        } 
    </script> 
    [Attach OnClientItemCollapse event to RadPanelBar]

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 22 Oct 2009 Link to this post

    Hi MD,

    Please find below a sample code snippet that shows the needed approach.

    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
     
        <script type="text/javascript">
            function OnClientItemCollapse(sender, eventArgs) {
                var item = eventArgs.get_item();
                setTimeout(function() { item.unSelect(); }, 0);
            }
     
        </script>
     
        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Forest" OnClientItemCollapse="OnClientItemCollapse">
            <Items>


    Kind regards,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top