Sunday, March 11, 2012

Combine Gridview and Accordion

Hi Stephen,

I think you can wrap the GridView in the Header of the AccordionPane. For instance:

<ajaxToolkit:Accordion ID="MyAccordion" runat="server" SelectedIndex="0"
HeaderCssClass="accordionHeader" ContentCssClass="accordionContent"
FadeTransitions="false" FramesPerSecond="40" TransitionDuration="250"
AutoSize="None" RequireOpenedPane="false"><Panes>
<ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server" HeaderCssClass="myclass">
<Header><asp:GridView ......></asp:GridView></Header> ...........

Hope this helps.


Actually this didnt seem to work, but I've gone a different route. Im instead building the header and using DetailViews inside the panes.

A quick thumbs up to the Ajax team. I'm fairly new to VS2005 and C# in general, but the toolkit has been amazingly easy to use coming from a PHP coder's standpoint.

Thanks,

Stephen


Can you share the code that you used im looking at doing the same thing

Thanks


I'm using an Accordion databound with a DetailsView in the pane. I'm a bit new to ASP.net and C#, but I hope this helps.

Thanks,

Stephen

<cc1:AccordionID="WIPAccordion"runat="server"SelectedIndex="0"HeaderCssClass="accordionHeader"ContentCssClass="accordionContent"FadeTransitions="false"FramesPerSecond="40"TransitionDuration="250"AutoSize="Fill"RequireOpenedPane="false"SuppressHeaderPostbacks="true"DataSourceID="WIPDataSource">

<HeaderTemplate>

<asp:Tablerunat="server"Width="100%"GridLines="Horizontal"BackColor="#1c5e55"ForeColor="WHITE"Font-Bold="true">

<asp:TableRow>

<asp:TableCellWidth="25%">

<%#DataBinder.Eval(Container.DataItem,"JobID")%>

</asp:TableCell>

<asp:TableCellWidth="50%">

<%#DataBinder.Eval(Container.DataItem,"CaseName")%>

</asp:TableCell>

<asp:TableCellWidth="25%">

<%#DataBinder.Eval(Container.DataItem,"Owner")%>

</asp:TableCell>

</asp:TableRow>

</asp:Table>

</HeaderTemplate>

<ContentTemplate>

<asp:DetailsViewID="DetailsView2"Width="100%"runat="server"DataKeyNames="JobID"DataSourceID="WIPDataSource"PageIndex=<%#DataBinder.GetPropertyValue(Container, "DataItemIndex")%>/>

</ContentTemplate>

</cc1:Accordion>

No comments:

Post a Comment