ASP.NET Splitter - Knowledge Base

« Back to Knowledge Base list

Collapse/expand a splitter panel from the same link

Q:

How to collapse/expand a splitter panel from the same link?

A:

Set the CollapsePanel property to left in case you need to collapse/expand the left panel, to right otherwise.

        <obspl:Splitter id="Splitter1" runat="server" CollapsePanel="left" ...


Define the link you want to use for collapse/expand the splitter panel.

        <a href="javascript:CollapseExpand()">Collapse/expand the left panel</a>


Put the following script inside the head section of your page.
        <script type="text/javascript">
                function CollapseExpand()
                {
                        if (splDV.ob_spl_Od)
                                splDV.ExpandPanel('left');
                        else
                                splDV.CollapsePanel('left');
                }
        </script>


"We are a current owner of the Infragistics suite - but will be immediately purchasing your components as they are far and away better than anything I have seen out there. Great stuff! I can't believe I haven't come across your components before."

David Adams
NJS Enterprises, Inc.