RadPanelBar Expand Collapse Issue

2 posts, 0 answers
  1. VIJESH
    VIJESH avatar
    13 posts
    Member since:
    Oct 2012

    Posted 03 Sep 2013 Link to this post

    I have the below line in my header template of radpanelbar.
    <td style="text-align: right"><span class="rpExpandHandle" style="cursor: pointer;"></span></td>
    I want to capture this expand collapse event from onclientitemclicking function.
    On expanding/collapsing i want to prompt the user. How can i achieve this.
  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 06 Sep 2013 Link to this post

    Hello VIJESH,

    Thank you for contacting Telerik Support.

    For your case you could use OnClientItemClicking event. Here is a sample code how you could use it:
            <telerik:RadPanelBar runat="server" ID="PanelBar1" OnClientItemExpand="OnClientItemExpand" OnClientItemClicking="OnClientItemClicking">
                <Items>
                    <telerik:RadPanelItem Text="item1">
                        <HeaderTemplate>
                            <div style="width:100px; height:10px; background-color:red" ></div>
                        </HeaderTemplate>
                        <Items>
                            <telerik:RadPanelItem Text="item 1.1"></telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="item 1.1"></telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                    <telerik:RadPanelItem Text="item2">
                        <Items>
                            <telerik:RadPanelItem Text="item 2.1"></telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="item 2.1"></telerik:RadPanelItem>
                        </Items>
                    </telerik:RadPanelItem>
                </Items>
            </telerik:RadPanelBar>
     
    <script type="text/javascript">
        function OnClientItemClicking(sender, args) {
            console.log("clicking");
        }
     
        function OnClientItemExpand(sender, args) {
            console.log("expand");
     
        }
    </script>


    I will be glad to assist you further.

    Regards,
    Peter Filipov
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top