[CLOSED] FitLayout and Master Page problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] FitLayout and Master Page problem

    Hi,
    I am building a web portal with the following requirements:
    - fixed body with of 1024px
    - grids should fill up 100% vertical space using scrolling

    Watching previous got the following files.

    <uc4:TestForm ID="TestForm1" runat="server" />
    <uc1:TestGrid ID="TestGrid1" runat="server" />

    TestForm1 and TestGrid1 are simple user controls containing respectively a form example and a grid example.

    The problem is that if the grid is inside a contentPlaceholder is not displayed.
    The grid works correctly if I put it directly in master page (insted of aspx file); please, see attached image.

    Click image for larger version. 

Name:	example.jpg 
Views:	86 
Size:	86.7 KB 
ID:	4772


    If you can suggest a better way to accomplish this it is very welcome.
    Thanks in advance

    M

    ExtNetTest.Master

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="ExtNetTest.master.cs" Inherits="renosistemi.it.MasterPages.ExtNetTest" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register src="~/Controls/HeaderReno.ascx" tagname="HeaderReno" tagprefix="uc2" %>
    <%@ Register src="~/Controls/TestGrid.ascx" tagname="TestGrid" tagprefix="uc1" %>
    <%@ Register src="~/Controls/Footer.ascx" tagname="Footer" tagprefix="uc3" %>
    
    <!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 id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form2" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
            <ext:Viewport ID="Viewport1" runat="server" Layout="HBoxLayout" BodyStyle="background-color: transparent;" >
            <LayoutConfig>
                <ext:HBoxLayoutConfig Pack="Center" Align="Stretch" />
            </LayoutConfig>
            <Items>
     
                <ext:Container ID="mainContainer" runat="server" Width="1024"  Layout="BorderLayout" StyleSpec="background-color: transparent;">
                <Content>           
                    <ext:Panel
                    ID="btns"
                    runat="server"
                    Region="Center"
                    Layout="FitLayout"    
                    Border="false"
                    BodyStyle="background-color: transparent;"
                    >
                    <Items>
    <ext:Panel
                ID="pnlFlexStretch"
                runat="server"
                Layout="VBoxLayout"
                Border="false"
                BodyStyle="background-color: transparent;"
                 >
                <LayoutConfig>
                    <ext:VBoxLayoutConfig Align="Stretch" />
                </LayoutConfig>
                <Items>
                    <ext:Container ID="headerCtrlContainer" runat="server" Flex="2" StyleSpec="background-color: transparent;"  >
                    <Content>
                    <uc2:HeaderReno ID="HeaderReno1" runat="server" />
                    </Content>
                    </ext:Container>
                     <ext:Container ID="staticContent" runat="server" Flex="6"  StyleSpec="background-color: transparent;"  >
                     <Content>                 
                     <asp:ContentPlaceHolder ID="cpStaticContent" runat="server"></asp:ContentPlaceHolder>
                     </Content>
                     </ext:Container>
                     <ext:Container ID="flexContainer" runat="server" Flex="10" Layout="FitLayout" StyleSpec="background-color: transparent;" >
                    <Content>
                        <asp:ContentPlaceHolder ID="cpFlexContainer" runat="server"></asp:ContentPlaceHolder>                
                    </Content>
                    </ext:Container>
                    <ext:Panel ID="footerCtrlContainer" runat="server" Flex="1" Border="false" StyleSpec="background-color: transparent;" >
                            <Content>
                                <uc3:Footer ID="Footer1" runat="server" />
                            </Content>
                        </ext:Panel>
     
                </Items>
            </ext:Panel>
                    </Items>
                </ext:Panel>
            </Content>
                </ext:Container>
            </Items>
        </ext:Viewport>
        
        </form>
    </body>
    </html>


    Test2.aspx

    
    <%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPages/ExtNetTest.Master" CodeBehind="Test6.aspx.cs" Inherits="renosistemi.it.Test6" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register src="~/Controls/TestGrid.ascx" tagname="TestGrid" tagprefix="uc1" %>
    <%@ Register src="~/Controls/TestForm.ascx" tagname="TestForm" tagprefix="uc4" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="cpStaticContent" runat="server">
        <uc4:TestForm ID="TestForm1" runat="server" />
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="cpFlexContainer" runat="server">
        <uc1:TestGrid ID="TestGrid1" runat="server" />
    </asp:Content>
    Last edited by Daniil; Sep 14, 2012 at 7:13 AM. Reason: [CLOSED]
  2. #2
    Hi,

    The problem is the fact that a GridPanel from the user control doesn't become an item of the flexContainer container. It is rendered as raw HTML. So, FitLayout doesn't affect it.

    To avoid it, please wrap a user control in an additional <ext:Container> with FitLayout.
  3. #3
    It works.
    Thanks, Daniil.
    M

Similar Threads

  1. Replies: 1
    Last Post: Sep 08, 2013, 5:10 AM
  2. Replies: 0
    Last Post: Jul 30, 2012, 10:39 AM
  3. Replies: 3
    Last Post: Nov 30, 2011, 10:39 AM
  4. Replies: 2
    Last Post: May 05, 2010, 10:23 AM
  5. master page problem
    By alexp in forum 1.x Help
    Replies: 1
    Last Post: Nov 21, 2008, 5:29 AM

Posting Permissions