How to make collapsable panel in datalist using Ajax?


The Code for this functionality is given below

<asp:DataList ID=”DatalistFNO” runat=”Server”>
<ItemTemplate>
<table>
<tr>
<td width=”400px” style=”background-color: #FFCACA;”>
<asp:Panel ID=”description_HeaderPanel” runat=”server” style=”cursor: pointer;” >
<div>
<font style=”font-family:Arial, Helvetica, sans-serif; font-size:12px”>&nbsp;<b><%# Eval(“FAQ_Question”)%></b></font>
</div>
</asp:Panel>
</td>
</tr>
<tr>
<td>
<asp:Panel id=”description_ContentPanel” runat=”server” style=”overflow:hidden;”>
<p>
<%#Eval(“FAQ_Answer”)%>
</p>
</asp:Panel>

<cc1:CollapsiblePanelExtender ID=”cpeDescription” runat=”Server”
TargetControlID=”description_ContentPanel”
ExpandControlID=”description_HeaderPanel”
CollapseControlID=”description_HeaderPanel”
Collapsed=”true” SuppressPostBack=”true” />

</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>

Advertisement

2 thoughts on “How to make collapsable panel in datalist using Ajax?

  1. ravi September 2, 2013 / 7:18 pm

    nice article.. Thanks

  2. ravi September 2, 2013 / 7:21 pm

    i want to ask 1 thing, if we want to show only one desc. opened not all. Here what happens that whe i click on header it expand that. also if i click on 2nd then it also expand 2nd. But it should be like only 1 expanded at a time.. Can u plz tell me …

    Thanks for advance…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.