J
Jim H
Let me start by saying that this whole project is a C# project and I don't
know ASP. I am posting to this group because of a suggestion by someone in
a response in the C# group.
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
know ASP. I am posting to this group because of a suggestion by someone in
a response in the C# group.
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