Please!!! Need help with WebUI.Panel

J

Jim H

I have a web application which has a WebUI.PlaceHolder on it. I have a
single custom Output rendering control that has a bunch of WebUI.Table
controls (the number is determined at run time) that I add using
Controls.Add during CreateChildControls of the renderer. Everything works
fine with that. Now I want to Add groups of tables into panels and add the
panels to the renderer control.
What I do is this:

I loop through my data. In the loop I create a Panel dynamically by
creating an instance of a new Panel().
I add all my controls to the Panel by calling
lPanel.Controls.Add(myControl).
Then I add the Panel control to my renderer by calling Controls.Add(lPanel)
just like I used to with the tables.

The problem is that all of the panels are opening up inside of eachother. I
need then one under the other.

code chunk:

int i = 0;
foreach(DataRow lRow in m_tOIResults.Rows)
{
lPanel = new Panel();
lPanel.ID = string.Format("Rpt{0}", i); //each panel get a different
name
i++;

//put a border on so I can see where each panel starts and ends
lPanel.BorderStyle = BorderStyle.Inset;

//alternate panel background colors to make it easier to see what's
going on
if(((float)i / 2.0) != (i / 2))
lPanel.BackColor = System.Drawing.Color.Aqua;
else
lPanel.BackColor = System.Drawing.Color.DarkGreen;

//create some loaded tables
lPanel.Controls.Add(MyTable1);
//more of the same here.
this.Controls.Add(lPanel);
}

When I set borders on the panels I can see that each panel is opening up
inside the panel before it right after the tables.

I even add a LiteralControl in the loop - this.Controls.Add(new
LiteralControl("Jim was here"));
That text apears in eachof the last panels.
Any ideas as to why and what I can do to stop this? What am I doing wrong?

jim

PS VS .NET 2003 Enterprise Architect
 
V

Vadim Chekan

Jim said:
I have a web application which has a WebUI.PlaceHolder on it. I have a

You have more chances to get help when you post to proper group:
microsoft.public.dotnet.languages.aspnet.

Vadim Chekan.
 
J

Jim H

This is a C# project and all of the code is C#. Should I still post in the
asp.net group?

jim
 
J

Jacob Yang [MSFT]

Hi Jim,

I noticed that you have posted the same question in the
microsoft.public.dotnet.framework.aspnet group. I have replied you on that
thread. Please check it when you have time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top