Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm having a collapsible panel extender which works propery on click of the panel.
But it is getting closed when i click any of the controls inside the Collapsible panel

Please advise

XML
<asp:Panel ID="initial" runat="server" CssClass="pnlCSS">
                    <div style="background-image:url('../images/collapsepanel.jpg'); height:30px; vertical-align:middle">
                    <div  height:30px; vertical-align:middle">

                    <div style="float:left; color:White;padding:5px 5px 0 0">
                    <asp:Image ID="Image1" runat="server" />                <strong> Fraud Indicators for Occupancy </strong>   </div>

                    </div>
                </asp:Panel >
                <asp:Panel ID="collapseOccupancy" runat="server" CssClass="pnlCSS">
                    <table cellspacing = "10px" bgcolor="#F0F1F3" style="border: thin solid #D6D6D6; width: 100%">
                    <tr>
                    <td>
                    <asp:GridView ID="gvOccupancy" runat="server"  AutoGenerateColumns="False" CssClass="gridView"
                        DataKeyNames="Qid" Width="100%">
                        <Columns>
                           <asp:boundfield datafield="QNo" headerText="#"/>
                            <asp:boundfield datafield="question" />
                            <asp:boundfield datafield="risk_rating" HeaderText="Level" ItemStyle-HorizontalAlign="center" />
                            <asp:TemplateField headertext="Description">
                                <ItemTemplate>
                                    <asp:RadioButtonList runat="server" id="rb1Answer" RepeatDirection="Horizontal" RepeatLayout="Flow">
                                        <asp:listitem Text="Yes" value="Yes" />
                                        <asp:listitem Text="No" value="No" />
                                        <asp:listitem Text="N/A" value="N/A" />
                                    </asp:RadioButtonList><br />
                                    <asp:textbox id="txtComments" runat="server" textmode="multiline" height="40" width="600" OnKeyPress="max_Length(event, this, 200)" />
                                    <asp:radiobuttonlist id="rblOptions" runat="server" RepeatLayout="Flow" />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                    </td>
                    </tr>
                    </table>
                </asp:Panel>
                 <ajax:CollapsiblePanelExtender        ID="cOccupancy"        runat="server"        CollapseControlID="initial"
                                              Collapsed="true"        ExpandControlID="initial"
                                              ImageControlID="Image1"        CollapsedImage="~/images/downarrow.jpg"
                                              ExpandedImage="~/images/uparrow.jpg"        ExpandDirection="Vertical"
                                              TargetControlID="CollapseOccupancy"        ScrollContents="false">
                </ajax:CollapsiblePanelExtender>
Posted
Updated 30-Jul-13 23:33pm
v2
Comments
Jameel VM 31-Jul-13 5:31am    
Please post the code what you have tried.
Member 10112611 31-Jul-13 5:34am    
updated with code..I cannot even click inside the text box control within the grid. panel get collapsed
Harshil_Raval 31-Jul-13 5:33am    
Please post your try on this.
Member 10112611 31-Jul-13 5:36am    
updated my code block..

1 solution

Try setting AutoCollapse="False" in ajax:CollapsiblePanelExtender.
 
Share this answer
 
Comments
Member 10112611 31-Jul-13 5:55am    
I tried AutoCollapse="False" ...but not working...still same problem...i got a sample code form net... http://www.aspdotnet-suresh.com/2011/04/ajax-collapsible-panel-control-sample.html

in that this same code only used ..but no error like mine there.. Is this anything specific to gridview?
Member 10112611 31-Jul-13 5:58am    
even with a simple textbox inside the CPE..the same error...i tried
Harshil_Raval 31-Jul-13 6:16am    
Every thing looks fine with your code. I have one doubt only why you take table structure? And in that structure you have taken gridview. May be it's not problem, but try to comment that table structure and in "collapseOccupancy" panel put only gridview. See what happen? or try to replace table structure with div. Hope it works..
Member 10112611 31-Jul-13 6:33am    
@Harshil..i tried removing table..same problem...please note this collapse occurs during mouse click on any of the controls
Member 10112611 31-Jul-13 6:32am    
I can type inside the control if focus is there. but on mouseclick it is getting collapsed

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900