Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
Splitter not collpasing when setting: WebSplitter1.Panes[0].Collapsed = true
posted

WebSplitter1.Panes[0].Collapsed = true

If this is executed in the page load event it works, but it does not work from a button click event.

What am I missing.

I have a ultrawebtree that loads a user control into the bottom pane (update panel) of a horizontal splitter bar. For this particular control I want to collapse (top) splitter bar.

I execute WebSplitter1.Panes[0].Collapsed = true in the same event that loads the usercontrol (LoadControl). The control loads just fine but the splitter bar does nto collapse. What am I missing?

 

  • 28407
    posted

    HI,

     I am assuming you are doing this on the Server_Side - then make sure you have Your AutoPostBackFlags set properly.

     Here is a help link:

    http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Infragistics2.Web.v8.3~Infragistics.Web.UI.LayoutControls.WebSplitter~AutoPostBackFlags.html

    I wrote a small applicaton that will collapse the pane on a button-click.

    Here is my aspx page:

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

    <%@ Register assembly="Infragistics2.Web.v9.1, Version=9.1.20091.2015, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.LayoutControls" tagprefix="ig" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
        <script type="text/javascript">
        function Collapsed(sender, splitargs){
        debugger;
        }
        function Expanded(sender, splitargs) {
        debugger;
        }
       </script>

    </head>
    <body>
        <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <div>
                <ig:WebSplitter ID="WebSplitter1" runat="server" Height="200px"
                    oncollapsed="WebSplitter1_Collapsed" onexpanded="WebSplitter1_Expanded"
                    Width="300px">
                    <AutoPostBackFlags Collapsed="On" Expanded="On" />
                    <panes>
                        <ig:SplitterPane runat="server" CollapsedDirection="NextPane">
                        </ig:SplitterPane>
                        <ig:SplitterPane runat="server" CollapsedDirection="NextPane">
                        </ig:SplitterPane>
                    </panes>
                    <ClientEvents Collapsed="Collapsed" Expanded="Expanded" />
                </ig:WebSplitter>
            </div>
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
        </form>
    </body>
    </html>


    Here is my Code_Behind:

     using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void WebSplitter1_Collapsed(object sender, Infragistics.Web.UI.LayoutControls.SplitterPaneCollapsedEventArgs e)
        {

        }
        protected void WebSplitter1_Expanded(object sender, Infragistics.Web.UI.LayoutControls.SplitterPaneExpandedEventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            WebSplitter1.Panes[0].Collapsed = true;
        }
    }