PDA

View Full Version : CenterLayout in code behind- noob



dscott
Nov 28, 2008, 3:52 PM
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.

geoffrey.mcgill
Nov 28, 2008, 7:41 PM
Hi dscott,

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