[CLOSED] How should I rewrite this code in v1 to v2?

  1. #1

    [CLOSED] How should I rewrite this code in v1 to v2?

    Hi,

    here's code from version v1:
    Ext.Net.Container panelLeftContainer = new Ext.Net.Container();
                    panelLeftContainer.ID = "panelLeftContainer_" + this.ID;
                    Ext.Net.Container panelRightContainer = new Ext.Net.Container();
                    panelRightContainer.ID = "panelRightContainer_" + this.ID;
                    panelLeftContainer.AnchorHorizontal = "50%";
                    panelLeftContainer.MonitorResize = true;
                    panelRightContainer.AnchorHorizontal = "50%";
                    panelRightContainer.MonitorResize = true;
                    foreach (var p in panelList.Items)
                    {
                        if (panelList.Items.IndexOf(p) % 2 == 0)
                            panelLeftContainer.Items.Add(p);
                        else if (!panelRightContainer.Items.Contains(p))
                        {
                            panelRightContainer.Items.Add(p);
                        }
                    }
    
                    LayoutColumn layoutColumn1 = new LayoutColumn { ColumnWidth = 0.5M };
                    layoutColumn1.Items.Add(panelLeftContainer);
                    LayoutColumn layoutColumn2 = new LayoutColumn { ColumnWidth = 0.5M };
                    layoutColumn2.Items.Add(panelRightContainer);
    
                    ColumnLayout columnLayout = new ColumnLayout { ID="columnLayout_"+this.ID, Width = Unit.Pixel(800), Split = true, FitHeight = false, ColumnWidth = 0.5 };
                    columnLayout.Columns.Add(layoutColumn1);
                    columnLayout.Columns.Add(layoutColumn2);
                    this.AnchorHorizontal = "100%";
                    this.MonitorResize = true;
                    this.Items.Add(columnLayout);//in this case 'this' is a container control
    Last edited by Daniil; Apr 30, 2013 at 4:13 AM. Reason: [CLOSED]
  2. #2
    Hi @ViDom,

    You should use a Container's Layout or LayoutConfig property instead of the ColumnLayout control.

    Also please forget about a LayoutColumn.

    Each a Container's items (a component added to a Container's Items collection) represents a column. For example, you should set up the ColumnWidth property direct for a Container's item.

    This example demonstrates the structure I am talking about.
    https://examples2.ext.net/#/Layout/ColumnLayout/Basic/

Similar Threads

  1. Replies: 1
    Last Post: Nov 13, 2012, 1:36 PM
  2. [CLOSED] After UserControl rewrite javascript error occured
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 18, 2012, 10:22 AM
  3. Grid + MVC 3 + EF Code First + CRUD - Error code 200
    By millenovanta in forum 2.x Help
    Replies: 5
    Last Post: Sep 08, 2012, 4:31 PM
  4. Replies: 2
    Last Post: Feb 01, 2012, 6:56 AM
  5. Replies: 1
    Last Post: Jul 07, 2011, 8:34 PM

Tags for this Thread

Posting Permissions