Hi,
I think you can wrap all elements in a normal Panel, then place the Panel inside the accordion panel. And you'll be able to set this panel as the target of the extender.
Hope this helps.
Thanks for your reply. Unfortunately, I am having a hard time getting this to work - probably because I am not putting it in the right place. I have tried multiple locations and it either does nothing or causes a page error (element does not exist).
If you can guide me to the correct location in the below code, I would appreciate it.
Thank you!
<cc1:Accordion ID="Accordion1" runat="server" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" SelectedIndex="0" FadeTransitions="True" FramesPerSecond="40" TransitionDuration="250" AutoSize=None Visible=false><Panes> <cc1:AccordionPane ID="AccordionPane0" runat="server"> <Header> <uc2:RecHeader id="RecHeader0" runat="server"></uc2:RecHeader> </Header> <Content> <uc1:RecDetail ID="RecDetail0" runat="server" /> </Content> </cc1:AccordionPane> <cc1:AccordionPane ID="AccordionPane1" runat="server"> <Header> <uc2:RecHeader id="RecHeader1" runat="server"></uc2:RecHeader> </Header> <Content> <uc1:RecDetail ID="RecDetail1" runat="server" /> </Content> </cc1:AccordionPane>
Here's my code for a working version:
<ContentTemplate> <asp:Panel ID="Panel1" BackColor="#FF8000" runat="server" Height="50px" Width="750px"> <p>CONTENT</p> </asp:Panel> <cc1:RoundedCornersExtender ID="RoundedCornersExtender1" Corners="bottom" runat="server"> </cc1:RoundedCornersExtender> </ContentTemplate>
Mine's databound and I set the extender's targetControlID in the codebehind, so all you'll have to do is manually pop those in each content section and set the target to the right panels.
Thanks for you reply. Unfortunately, I am still having a hard time getting this to display properly.
As you can see from my above code, both the Header and the Content of the AccordionPane are being populated by UserControls. I am trying to change the Header, correct? Within my UserControl for the header, I encapsulated everything in a panel like this:
<ItemTemplate> <asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px"> <asp:Label ID="PartNumberLabel" runat="server" Text='<%# Bind("PartNumber")%>'></asp:Label> </asp:Panel> <cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="Panel1"> </cc1:RoundedCornersExtender> </ItemTemplate>...but I can not see a visible change on the Accordion. Am I changing the right area, or do I need to change the Content section?
I tried adding the panel within the accordion pane itself, but I got this error:
I would appreciate any further guidance. Thank you!
Well in the 2nd piece of code, the panel should go inside of the content section
<Header>
</Header
<Content>
<Panel>
<recdetail>
</Panel>
</Content>
But yes, I'm really not sure why the first piece of code fails, but then again, I'm far from an expert on this.
After playing around with it some more, I was able to get the effect I wanted by putting the entire accordion control within a panel. I thought I tried that before, but I guess I missed it.
Thanks again for your continued feedback & help.
can you post some code or explain a bit more?
Here is an example of what I meant:
<asp:Panel ID="Panel1" runat="server" BackColor=blue> <cc1:Accordion ID="Accordion1" runat="server" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" SelectedIndex="0" FadeTransitions="True" FramesPerSecond="40" TransitionDuration="250" AutoSize=None Visible=false><Panes></Panes> </cc1:Accordion></asp:Panel> <cc1:RoundedCornersExtender ID="RoundedCornersExtender1" runat="server" TargetControlID="Panel1"> </cc1:RoundedCornersExtender>As you can see, I just put the whole accodion control within the panel, and then set the back color to something that worked with my style. To really see what is happening, change the panel's backcolor to something that really stands out - like "red". You can then see exactly how the RoundedCorners extender is affecting the panel. Hopefully this gives you some idea of what to try.
0 件のコメント:
コメントを投稿