<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="RadPanelbar.Net2" Namespace="Telerik.WebControls" TagPrefix="radP" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>

</head>
<body>
    <form id="form1" runat="server">
    <script type="text/javascript">
    
  function ExpandItem( ExpandIt )
    {
        var panelbar = <%= RadPanelbar1.ClientID %>;
        var text = document.getElementById("TextBox1").value;
        
        var item = panelbar.FindItemByText(text);
        
        if (item)
        {
            if ( ExpandIt )
                item.Expand();
            else
                item.Collapse(); 
        }
        else
        {
            alert("Item with text '" + text + "' not found.");
        }
    }
    
    function EnableItem( EnableIt )
    {
        var panelbar = <%= RadPanelbar1.ClientID %>;
        var text = document.getElementById("TextBox1").value;
        
        var item = panelbar.FindItemByText(text);
        
        if (item)
        {
            if ( EnableIt )
              item.Enable();
            else
              item.Disable();
        }
        else
        {
            alert("Item with text '" + text + "' not found.");
        }
    }
    
    function EnableAll( EnableThem )
    {
        var panelbar = <%= RadPanelbar1.ClientID %>;
        
        for (var i = 0; i < panelbar.AllItems.length; i++)
        {
            if ( EnableThem )
                panelbar.AllItems[i].Enable();
            else
                panelbar.AllItems[i].Disable(); 
        }
    }
    </script>    
    <div>
        <table style="width: 553px">
            <tr>
                <td align="left" style="width: 346px" valign="top">
                    <radP:RadPanelbar ID="RadPanelbar1" runat="server">
                    </radP:RadPanelbar>
                </td>
                <td align="left" style="width: 342px" valign="top">
                    &nbsp;<asp:TextBox ID="TextBox1" runat="server" Width="223px"></asp:TextBox>
                    <br />
                    <button class="button" onclick="ExpandItem( true );return false;">Expand</button><br />
                    <button class="button" onclick="ExpandItem( false );return false;">Collapse</button><br />
                    <button class="button" onclick="EnableItem( true );return false;">Enable</button><br />
                    <button class="button" onclick="EnableItem( false );return false;">Disable</button><br />
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
