I'm creating new AccordionPanes dynamically, using pane.HeaderContainer.Controls.Add() and pane.ContentContainer.Controls.Add(). I have two problems with the positioning of the content, which I assume are related.
First problem: The content appears to the right of the header, rather than below the header. (If I adjust the width of the header, that just moves the content left or right, but it doesn’t make it appear below the header.)
Second problem: The second pane header originally appears below the first pane, as expected. However, when the user clicks on the header of the second pane, both the header and the content of the second pane appear to the right of the header for the first
pane. If the user subsequently clicks on the header of the first pane, the second pane header returns to its original position (and the first pane content opens).
For each dynamically created pane, the header consists of an HtmlTable with one row. The content for each pane consists of a GridView inside a Panel (to provide scrollbars) – a regular panel, not an UpdatePanel.
Found the solution! When creating the HtmlTable in the header, I set table.Align = "left". My intention was to align the header, but it had the unintended consequence of aligning the entire AccordionPane.
The successful way to do what I was attempting was pane.ContentContainer.HorizontalAlign = HorizontalAlign.Left
silverlightb...
Member
14 Points
4 Posts
Relative position of header and content in AccordionPane
Feb 17, 2012 05:46 AM|LINK
I'm creating new AccordionPanes dynamically, using pane.HeaderContainer.Controls.Add() and pane.ContentContainer.Controls.Add(). I have two problems with the positioning of the content, which I assume are related.
First problem: The content appears to the right of the header, rather than below the header. (If I adjust the width of the header, that just moves the content left or right, but it doesn’t make it appear below the header.)
Second problem: The second pane header originally appears below the first pane, as expected. However, when the user clicks on the header of the second pane, both the header and the content of the second pane appear to the right of the header for the first pane. If the user subsequently clicks on the header of the first pane, the second pane header returns to its original position (and the first pane content opens).
For each dynamically created pane, the header consists of an HtmlTable with one row. The content for each pane consists of a GridView inside a Panel (to provide scrollbars) – a regular panel, not an UpdatePanel.
silverlightb...
Member
14 Points
4 Posts
Re: Relative position of header and content in AccordionPane
Feb 17, 2012 03:32 PM|LINK
Found the solution! When creating the HtmlTable in the header, I set table.Align = "left". My intention was to align the header, but it had the unintended consequence of aligning the entire AccordionPane.
The successful way to do what I was attempting was pane.ContentContainer.HorizontalAlign = HorizontalAlign.Left