CenterLayout in code behind- noob

  1. #1

    CenterLayout in code behind- noob

    call me dumb but I can't figure out how to center things within panels, cells, etc. I figure it's with centerlayout but can't figure out the exact syntax. Here's what I am trying:

     
    Coolite.Ext.Web.TableLayout tbd = new Coolite.Ext.Web.TableLayout();
    Coolite.Ext.Web.CenterLayout cen = new Coolite.Ext.Web.CenterLayout();             
     Coolite.Ext.Web.Panel panel = new Coolite.Ext.Web.Panel();                            
    Coolite.Ext.Web.Cell cell = new Coolite.Ext.Web.Cell();                            
    
    panel.Title = "my title"; 
    panel.Html="Some html here"; 
    cen.Items.Add(panel)
    cell.Items.Add(cen);
    tbd.Cells.Add(cell);

    when I do this it throws "System.InvalidOperationException:
    Parent for Layout Control (_ctl2) must be a Coolite Container Control,
    such as Panel, TabPanel, Window, ViewPort, etc"

    Any help would be greatly appreciated. There doesn't appear to be any examples that show how to use the centerlayout within code.

    Also note to devs. seeing as alignment is quite a critical thing couldn't we have a property on a panel like "HorizontalAlign" then have the ability to set it to Left;Center:Right.


  2. #2

    RE: CenterLayout in code behind- noob

    Hi dscott,

    I'll make you a code-behind sample for the CenterLayout. I'll post a code sample shortly.*


    Geoffrey McGill
    Founder

Similar Threads

  1. Pretty noob question... :(
    By kabalkunz in forum 1.x Help
    Replies: 7
    Last Post: Aug 26, 2011, 7:54 PM
  2. [CLOSED] CenterLayout / Scroll Issue
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 19, 2010, 1:16 PM
  3. [CLOSED] CenterLayout issue w/CompositeFields
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 19, 2010, 1:17 PM
  4. CenterLayout behavor
    By bas in forum 1.x Help
    Replies: 1
    Last Post: Sep 30, 2009, 12:47 PM

Posting Permissions