[CLOSED] Layout VBox in complicated collapsed?

  1. #1

    [CLOSED] Layout VBox in complicated collapsed?

    Hi,

    Here is example:

    .aspx
    <%@ Page Language="C#" %>
    <%@ Register tagPrefix="uc" namespace="ServerControls" assembly="ServerControls" %>
    <%@ Register tagPrefix="ext" namespace="Ext.Net" assembly="Ext.Net" %>
    <!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></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <ext:ResourceManager runat="server"></ext:ResourceManager>
            <ext:Viewport runat="server">
                <Items>
                    <uc:ServerControl runat="server" Title="Title" Layout="Fit"/>
                </Items>
            </ext:Viewport>
        </div>
        </form>
    </body>
    </html>
    serverControl:
    public class ServerControl : Ext.Net.Panel
        {
            private Ext.Net.VBoxLayout vBoxLayout;
            private Ext.Net.ColumnLayout columnLayout;
    
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                vBoxLayout = new VBoxLayout();
                BoxItem box1 = new BoxItem();
                box1.Flex = 0;
                Ext.Net.Panel p1 = new Panel();
                p1.Items.Add(new TextField());
                box1.Items.Add(p1);
                BoxItem box2 = new BoxItem();
                box2.Flex = 1;
                columnLayout = new ColumnLayout(){ColumnWidth = 0.5};
                LayoutColumn column1 = new LayoutColumn(){ColumnWidth = 0.5M};
                column1.Items.Add(new Panel(){Title = "p1"});
                LayoutColumn column2 = new LayoutColumn(){ColumnWidth = 0.5M};
                column2.Items.Add(new Panel(){Title="p2"});
                columnLayout.Columns.Add(column1);
                columnLayout.Columns.Add(column2);
                box2.Items.Add(columnLayout);
                this.Items.Add(vBoxLayout);
            }
        }
    there is displayed only Title of my server control without inside controls of it.
    Question is how can I fix it?

    Thanks,
    ViDom
    Last edited by Daniil; Nov 28, 2012 at 2:08 PM. Reason: [CLOSED]
  2. #2
    Hello!

    You should double check your markup of elements. Try this example:

    protected override void OnInit(EventArgs e) {
    	base.OnInit(e);
    	this.Layout = "VBoxLayout";
    	this.Height = 200;
    	Panel p1 = new Panel
    				{
    					Flex = 1
    				};
    	Panel p2 = new Panel
    				{
    					Flex = 1
    				};
    	p1.Items.Add(new TextField());
    	p2.Items.Add(new TextField());
    	
    	this.Items.Add(p1);
    	this.Items.Add(p2);
    }
    If you will continue experiencing this problem can you post a markup which you want to repeat in your control?
  3. #3
    Quote Originally Posted by Baidaly View Post
    Hello!

    You should double check your markup of elements. Try this example:

    protected override void OnInit(EventArgs e) {
    	base.OnInit(e);
    	this.Layout = "VBoxLayout";
    	this.Height = 200;
    	Panel p1 = new Panel
    				{
    					Flex = 1
    				};
    	Panel p2 = new Panel
    				{
    					Flex = 1
    				};
    	p1.Items.Add(new TextField());
    	p2.Items.Add(new TextField());
    	
    	this.Items.Add(p1);
    	this.Items.Add(p2);
    }
    If you will continue experiencing this problem can you post a markup which you want to repeat in your control?
    yours solution doesn't work :( blank page showed without event Title of Panel:(

    Javascript error ocurs : "SyntaxError: invalid label"
    which tell me nothing:(
  4. #4
    Hi @ViDom,

    Please review this message.
    Quote Originally Posted by Baidaly View Post
    If you will continue experiencing this problem can you post a markup which you want to repeat in your control?
    Generally, a full sample to reproduce the problem is appreciated.
  5. #5
    Sorry, @ViDom but I don't see any errors.

    I recommend you to simplify your solution step by step to figure out where is the problem or you can post a Markup then we can give you the CodeBehind code.

Similar Threads

  1. vbox layout is not working on image button
    By robertgan in forum 1.x Help
    Replies: 1
    Last Post: Feb 27, 2012, 9:17 AM
  2. [CLOSED] vbox layout inside column layout
    By craig2005 in forum 1.x Premium Help
    Replies: 2
    Last Post: Feb 04, 2011, 2:44 PM
  3. [CLOSED] [1.0] Issue with VBox Layout in Latest SVN
    By Hari_CSC in forum 1.x Premium Help
    Replies: 7
    Last Post: Jul 07, 2010, 5:07 PM
  4. Border Layout not getting collapsed
    By vivekrane1986 in forum 1.x Help
    Replies: 0
    Last Post: Jun 05, 2010, 6:23 AM
  5. Complicated layout problem
    By mrozik in forum 1.x Help
    Replies: 1
    Last Post: Mar 16, 2009, 6:57 AM

Tags for this Thread

Posting Permissions