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