I have a collapsible panel extender. I have no issues with the extender. however, I have a link that opens the panel and I want another link saying collapse to close it. I want to hide one show one javascript side. The issue is that it only works for the first row but not the others because I am not getting the unique ID or something. I haven't found a legitimate answer yet. I've tried jquery by getting parent elements and I was unsuccessful. What can I do?
Answer:
<asp:TemplateField HeaderText="Lng Descr" SortExpression="LongDescription">
<EditItemTemplate>
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("LongDescription") %>' TextMode ="MultiLine" Rows="5" ></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<table>
<tr id="expand" style="display:">
<td>
<asp:Label ID="Label3" runat="server" ForeColor="Blue"><u></u></asp:Label>
</td>
</tr>
</table>
<asp:Panel ID="Panel1" runat="server" >
<table>
<tr>
<td>
<%#Eval("LongDescription")%>
</td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:CollapsiblePanelExtender ID="cpe" runat="Server"
TargetControlID = "Panel1"
CollapsedSize="0"
ExpandedSize="50"
Collapsed="true"
ExpandControlID="Label3"
CollapseControlID="Label3"
AutoCollapse="false"
Scrollcontents="false"
collapsedText="<u>Expand"
ExpandDirection="Vertical"
ExpandedText = "<u>Collapse"
TextLabelID="Label3" />
</ItemTemplate>
</asp:TemplateField>