Hello all,
I have a panel sitting in a div, and I want to use that panel as a container to add more panels! Why would I want to add a panel to a panel? Because the panel that I'm adding to the existing panel, is also made to contain objects, but only and image and label.
The existing master container panel is created during design time, and goes by the lovely name of "toolboxpanel". During run time, I have a for/next loop that dynamically creates an image, a label, adds them both to a panel, then adds that panel to the toolboxpanel, as can be seen here:
For i = 0 To imageholder.Count - 1 'create a control
insertpanel = New Panel 'these object types have been DIM'd up above
insertimage = New Image
inserttext = New Label
inserttext.ID = "text" + partnumberholder(i) + i.ToString 'the "holder" arrays hold the goodies from my db
inserttext.Text = brandholder(i) + " " + partnumberholder(i)
insertimage.ID = "image" + partnumberholder(i) + i.ToString
insertimage.ImageUrl = ".\Images\Display\" + imageholder(i) + ".jpg"
insertpanel.CssClass = "drag" 'this allows the panel to be dragged around using a JQuery script elsewhere
'insertpanel.BackImageUrl = "~\Images\Display\" + imageholder(i) + ".jpg" 'commented out because this method looks awful
insertpanel.ID = "panel" + partnumberholder(i) + i.ToString
insertpanel.Controls.Add(insertimage)
insertpanel.Controls.Add(inserttext)
toolboxpanel.Controls.Add(insertpanel)
Next
The problem is, that each panel I add to the panel gets stuffed into 1 column and totally violates the css rules of the toolboxpanel that say max height is only 700px. It seems to stretch the panel, and the div its sitting in, to way higher than its supposed to be!
My main questions are:
1) How do I get it so I can add panel objects (with my image/label guts) to the main panel in a way where it will display with 3 columns, fixed viewable height, and tidy scroll bar?
2) Is there a better way of doing this? There has to be :(
You can see the current mess on the homepage of: http://www.mobiuspc.com
I appreciate any help! Bill