Register | Login

ZettaCube Forum and Knowledge Base

Welcome to ZettaCube forum. Here you can discuss various issues regarding our ZeeControls product. If you want to contact our developers directly, please email to support@zettacube.com.

Please register to post a message. Registration is immediate and free. Return users please login here.

 
  Forum  Discussions  Web Splitter  Resize WebsplitterPanel
Previous Previous
 
Next Disabled
New Post 4/22/2009 10:18 AM
Resolved
  Altran
4 posts
No Ranking


Resize WebsplitterPanel  

Hi everyone,

Is it possible to resize manualy a WebSplitterPanel in a WebSplitterContainer when another WebSplitterPanel is collapse below?

I hope you understand my question.

Thanks

Best regards

 
New Post 4/22/2009 11:02 AM
  ZettaCube Support
57 posts
No Ranking


Re: Resize WebsplitterPanel  

Dear Altran,

Please see if we interpreted your question correctly below:

You have a WebSplitterContainer, horizontally split into two WebSplitterPanels.  The lower one is collapsed.  Now you want to resize the upper one.

 

Since there is only one open (i.e. not collapsed/hidden) panel within the container, the size of that panel is effectively the same as the size of the container (well, approximately the same, because splitter bar and borders/margins of the container will take up some space).

If the WebSplitterContainer has its FitParent property set to FitWindow, then it is not possible to manually resize the upper panel. The panel will approximately be the same size as the browser window.

If the WebSplitterContainer is a standalone container, then you can manually resize the container, instead of resizing the panel.

 

We hope this can answer your question.

 

Regards

 

 
New Post 4/22/2009 11:21 AM
  Altran
4 posts
No Ranking


Re: Resize WebsplitterPanel  

Thanks for your answer but i've not explain corectly my problem.

I've a WebSplitterContainer  split into 4  horizontally WebSplitterPanel. The upper WebSplitter panel is not resizable. Only the 3 WebSplitterPanel are expandable on 1/3 Container size. But only one WebSplitterPanel can be expand at each times (Javascript function to collapse other WebSplitter when one is expand).

So when i've only one WebSplitterPanel expand, the other are collapse upper or down of this one.

For example the middle WebSplitterPanel is expand so the upper one is forwared collapse and the down WebSplitterPanel is too collapse.

I just want to resize manually the middle WebSplitterPanel but as the upper WebSplitterPanel is collapsed above this, the middle WebSplitterPanel can't resize.

I hope it's more clearly. If you speak french i think i can bet explain my problem.

Thanks

 
New Post 4/29/2009 10:38 PM
  ZettaCube Support
57 posts
No Ranking


Re: Resize WebsplitterPanel  

 After several private emails, we have clarified the problem and came up with a solution.  Here's a summary.

 

Requirements:

The developer wants to have a horizontally split WebSplitterContainer with 4 panels (let's call them panel A to panel D), with the following requirements:

  1. The first one (panel A) will always be visible
  2. Only one of the remaining three panels (panel B to D) is visible at a time (so when the end user clicks the Expand button of a panel, that panel will be expanded, and the one originally displaying will be collapsed)
  3. End user can drag the splitter bar to resize the 2 visible panels (panel A and one of panels B to D)
  4. End user can collapse the lower panel (one of panels B to D)

Analysis:

If there is only one WebSplitterContainer with 4 panels, then when the middle 2 panels are collapsed, end user will only be able to expand them, but will not be able to drag the splitter bar to resize the 2 panels that remain visible (i.e. panels A and D).  This is because panels A and D are actually not adjacent panels, they are separated by 2 collapsed panels.

Solution:

So instead of having one WebSplitterContainer, we add a nested container.  In our solution, the top-level container contains 2 panels (panel A, and a lower panel that contains a nested container).  The nested container then contains panel B to D.

End user will be able to resize the 2 panels of the top-level container, and collapse the lower panel of the top-level container.  (So requirements 1, 3 and 4 are satisfied)

A JavaScript handler is written to handle the OnClientPanelStateChanged event in the nested container. Whenever one of the panels B to D is expanded, the JavaScript handler will collapse the other 2 panels. (So requirement 2 is satisfied)

Source code:

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

<%@ Register Assembly="ZettaCube.ZeeControls" Namespace="ZettaCube.ZeeControls" TagPrefix="cc1" %>

<!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>

 

<script type="text/javascript">

var insideFunction = false;

function PanelOnStateChanged(panelId,oState,nState) {

    if (!insideFunction) {

        insideFunction = true;    

        var panels = [

                ZCWS.GetPanel('<%= Panel2.ClientID %>'), 

                ZCWS.GetPanel('<%= Panel3.ClientID %>'),

                ZCWS.GetPanel('<%= Panel4.ClientID %>')

            ];

        var currentPanelIndex = panelId.substring(panelId.length-1) - 2;      

        for (var i = 0; i < panels.length; i++) {

            if (i != currentPanelIndex) {

                // SetState will trigger PanelOnStateChanged, so use the insideFunction flag to prevent endless loop.

                panels[i].SetState((currentPanelIndex == 0) ? 1 : 2);

            }

        }

        insideFunction = false;

    }

}

</script>

    <form id="form1" runat="server">

    <div>   

        <cc1:WebSplitterContainer ID="WebSplitterContainer1" runat="server" Height="580px" Width="765px" Orientation="Horizontal">

            <Panels>

                <cc1:WebSplitterPanel runat="server" PreferredSize="200">

                    <Content>

                        Panel 1

                    </Content>

                </cc1:WebSplitterPanel>

                <cc1:WebSplitterPanel runat="server" Filled="True" CanCollapse="Forward">

                <Content>

                    <cc1:WebSplitterContainer ID="WebSplitterContainer2" runat="server" Height="694px" Width="926px" Orientation="Horizontal" OnClientPanelStateChanged="PanelOnStateChanged" FitParent="FitParentContainer">

                        <Panels>

                            <cc1:WebSplitterPanel ID="Panel2" runat="server" CanCollapse="Backward">

                                <Content>

                                    Panel 2

                                </Content>

                            </cc1:WebSplitterPanel>

                            <cc1:WebSplitterPanel ID="Panel3" runat="server" CanCollapse="Both" State="ForwardCollapsed">

                                <Content>

                                    Panel 3

                                </Content>

                            </cc1:WebSplitterPanel>

                            <cc1:WebSplitterPanel ID="Panel4" runat="server" CanCollapse="Forward" State="ForwardCollapsed">

                                <Content>

                                    Panel 4

                                </Content>

                            </cc1:WebSplitterPanel>

                        </Panels>

                    </cc1:WebSplitterContainer>

                </Content>

                </cc1:WebSplitterPanel>

            </Panels>

        </cc1:WebSplitterContainer>    

    </div>

    </form>

</body>

</html>

 

 
Previous Previous
 
Next Disabled
  Forum  Discussions  Web Splitter  Resize WebsplitterPanel
Copyright 2009 by ZettaCube Limited