I have a page with a gridview on it, and then under it a detailview for inserting rows into the gridview's database table. All works great, but I would like to put the detailview into a collapsible panel. I added the two panels, one for the linkbutton and
one for the detailview. The panel collapses and expands great. BUT when I try adding data to the controls in the detailview, click "insert", I get the message that no data was entered into the controls. When I comment out the ajax CollapsiblePanelExtender
code, it inserts the data just great. Any ideas?
I figured out what was going on with this. There was an anchor tag in the master page that was formatted like "<a id="top" />" that was throwing everything off. I changed it to <a id="top"></a>", and everything worked great.
Marked as answer by Ragged on Jan 10, 2013 06:03 PM
Ragged
0 Points
10 Posts
DetailsView within a Collapsible Panel used for inserting data
Dec 20, 2012 10:59 PM|LINK
I have a page with a gridview on it, and then under it a detailview for inserting rows into the gridview's database table. All works great, but I would like to put the detailview into a collapsible panel. I added the two panels, one for the linkbutton and one for the detailview. The panel collapses and expands great. BUT when I try adding data to the controls in the detailview, click "insert", I get the message that no data was entered into the controls. When I comment out the ajax CollapsiblePanelExtender code, it inserts the data just great. Any ideas?
Bobby-Z
Contributor
2838 Points
1120 Posts
Re: DetailsView within a Collapsible Panel used for inserting data
Dec 21, 2012 05:18 PM|LINK
How is this setup, is the insert button in the same panel as the detailsview, what is the linkbutton for?
Currently Learning: ASP, SQL, CSS, JavaScript, AJAX, XML, XSLT, C# So please be patient with me! Thanks
Ragged
0 Points
10 Posts
Re: DetailsView within a Collapsible Panel used for inserting data
Dec 21, 2012 05:42 PM|LINK
The insert button is the CommandField that comes with the DetailsView, such as:
<asp:CommandField ShowInsertButton="True" ValidationGroup="DetailsView" />
so it is in the panel (within the detailsview markup code).
The linkbutton, or I've also successfully used a label, is in the panel that is used to expand or collapse the collapsible panel.
<asp:Panel ID="TitlePanel" runat="server" CssClass="collapsePanelHeader" >
Add an Event
<asp:Label ID="Label5" runat="server" Text="Label">Add Details...</asp:Label>
</asp:Panel>
<asp:Panel ID="ContentPanel" runat="server" CssClass="collapsePanel">
<asp:DetailsView ID="DetailsView2" runat="server" AutoGenerateRows="False"
etc. DetailsView Code…
<asp:CommandField ShowInsertButton="True" ValidationGroup="DetailsView" />
</Fields>
</asp:DetailsView>
</asp:Panel>
<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1"
runat="server"
TargetControlID="contentPanel"
ExpandControlID="TitlePanel"
CollapseControlID="TitlePanel"
Collapsed="True"
CollapsedText="Show Details..."
ExpandedText="Add Event..."
SuppressPostBack="False"
TextLabelID="Label"
enabled="true" >
</asp:CollapsiblePanelExtender>
Ragged
0 Points
10 Posts
Re: DetailsView within a Collapsible Panel used for inserting data
Jan 10, 2013 06:03 PM|LINK
I figured out what was going on with this. There was an anchor tag in the master page that was formatted like "<a id="top" />" that was throwing everything off. I changed it to <a id="top"></a>", and everything worked great.