gridview column expand after expanding collapsible panel in gridview row

I have a collapsible panel inside gridview and once i expand it, not sure is this causes the first gridview column smaller as shown in attached pic. Despite of setting the size of the inner gridview in collapsible panel, the first column still become smaller.
before after
LVL 1
doramail05Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Muhammad ZamanSoftware Development LeadCommented:
Hi,

you have to set columns width properly, first define overall width of gridview then assign proper widths to each column as per you need. or attach your code please

cheers
doramail05Author Commented:
here they are :
<asp:GridView ID="gvClaimSummary"  HeaderStyle-BackColor="#B8A9DC"
                  AlternatingRowStyle-BackColor="#E4E0EE" HeaderStyle-ForeColor="White" 
                         BorderColor="Black" BorderWidth="1px" Width="1105px"
                         RowStyle-VerticalAlign="Top" AllowPaging="true" PageSize="10"
                  AutoGenerateColumns="false" runat="server" 
                          onrowdatabound="gvClaimSummary_RowDataBound" 
                        onpageindexchanging="gvClaimSummary_PageIndexChanging" 
                        onrowcommand="gvClaimSummary_RowCommand" onrowcreated="gvClaimSummary_RowCreated" 
                        >
                        
                        <FooterStyle CssClass="FooterStyle" />
                   <Columns>
                  
                  <asp:BoundField HeaderText="Date" DataField="Datecreated" HeaderStyle-Width="100px" 
                                       ItemStyle-Width="100px"
                                      ReadOnly="True"
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField>
                                
                  <%--<asp:BoundField HeaderText="Category" DataField="Category" 
                                      HeaderStyle-Width="20%"
                                      ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField>  --%> 
                                
                                <asp:TemplateField HeaderStyle-Width="60px" ItemStyle-Width="60px" HeaderText="Category">
                                     <ItemTemplate>
                                     <asp:Panel ID="pnl01" runat="server">
                                        <asp:Label ID="lbcategory" runat="server" Visible='<%# getMultipleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") + "(+)" %>' />
                                        <asp:Label runat="server" ID="spacer1">
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        &nbsp;&nbsp;</asp:Label>
                                         <asp:Label ID="lblDesc" runat="server" Visible="true" Text='<%# Eval("Description") %>' />
                                       <asp:Label runat="server" ID="spacer2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</asp:Label>
                                         <asp:Label ID="lblDetails" runat="server" Visible="true" Text='<%# Eval("Detail") %>' />
                                         <asp:Label runat="server" ID="spacer3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</asp:Label>
                                        
                                        
                                        <asp:Label ID="lblsubtotal" runat="server" Visible="true" Text='<%# Eval("Subtotal") %>' />
                                        </asp:Panel>
                                        <asp:Label ID="lblcategory" runat="server" Visible='<%# getSingleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") %>' />
                                        <br />
                                         <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" ExpandedText="asasddsa"  ExpandControlID="pnl01" CollapseControlID="pnl01" TargetControlID="panelmultiplecategory" Collapsed="true"></asp:CollapsiblePanelExtender>    
                                     
                                     <asp:Panel ID="panelmultiplecategory" runat="server"> 
                                         <asp:GridView ID="gvClaimSummaryMini" HeaderStyle-BackColor="#B8A9DC" 
                                          AlternatingRowStyle-BackColor="#E4E0EE" RowStyle-BackColor="White" HeaderStyle-ForeColor="White" 
                                                ShowHeader="false" BorderColor="Black" BorderWidth="0px" Width="700px" 
                                                 RowStyle-VerticalAlign="Top" AllowPaging="true" PageSize="10" CssClass="gvfixedtablewidth" 
                                          AutoGenerateColumns="false" runat="server">
                                          <Columns>
                                            <asp:BoundField DataField="Categoryname" ItemStyle-Width="120px" HeaderText="Category" HeaderStyle-Width="150px" ReadOnly="true" />
                                            <asp:BoundField DataField="Description" ItemStyle-Width="230px" HeaderText="Description" HeaderStyle-Width="150px" ReadOnly="true" />
                                            <asp:BoundField DataField="Details" ItemStyle-Width="150px" HeaderText="Details" HeaderStyle-Width="150px" ReadOnly="true" />                                                                    <asp:TemplateField HeaderStyle-Width="130px">
                                     <ItemTemplate>
                                           
                                                <asp:Label ID="lblAmountField" Visible="false" Text='<%# Eval("Amount") %>' runat="server" />
                                                 <%# GetUnitPrice(decimal.Parse(Eval("Amount").ToString())).ToString("N2") %>

                                          
                                        </ItemTemplate>
                                        
                                          <FooterTemplate>
                                          <%# GetTotal().ToString("N2") %>
                                        </FooterTemplate>

                                           

                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader22" runat="server" Text="Amount" Font-Names="Arial"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                      
                                </asp:TemplateField>
                                          </Columns>
                                         </asp:GridView>
                                     
                                     </asp:Panel>
                                     
                                     </ItemTemplate>
                                </asp:TemplateField>
                                
                                <%--<asp:TemplateField HeaderStyle-Width="100px">
                                     <ItemTemplate>
                                            
                                                <asp:Label ID="lblIDField" Visible='<%# getSingleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") %>' runat="server" />
                        <asp:HyperLink ID="hp01" runat="server" Visible='<%# getMultipleVisibility(Eval("Category").ToString()) %>' Text="Multiple" />
                        
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader" runat="server" Text="Category" Font-Names="Times"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>--%>
                                
                                  <%--<asp:BoundField HeaderText="Amount" DataField="Amount" 
                                      HeaderStyle-Width="20%"
                                      ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>  
                                
                                <%--<asp:BoundField HeaderText="Description" DataField="Description" 
                                      HeaderStyle-Width="40%"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>
                                
                                 <asp:BoundField HeaderText="Description" DataField="Description" 
                                     ItemStyle-Width="50px" HeaderStyle-Width="50px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                 <asp:BoundField HeaderText="Details" DataField="Detail" 
                                     ItemStyle-Width="60px" HeaderStyle-Width="60px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                 <asp:BoundField HeaderText="Subtotal" DataField="Subtotal" 
                                       ItemStyle-Width="30px" HeaderStyle-Width="30px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                
                                
                                <%--<asp:BoundField HeaderText="Status" DataField="Status" 
                                      HeaderStyle-Width="20%"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>
                                
                                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-Width="20px">
                                     <ItemTemplate>
                                            <span style="float:right; padding-right:20px;">
                                                <asp:LinkButton ID="hledit5" runat="server" CssClass="viewbutton" CommandName="EDITCLAIMSUMMARY" CommandArgument='<%# (Container as GridViewRow).RowIndex %>'></asp:LinkButton>
                                                <asp:Label ID="lblID3Field" Visible="false" Text='<%# Eval("UCSID") %>' runat="server" />
                                                <asp:Label ID="lblCateField" Visible="false" Text='<%# Eval("Category") %>' runat="server" />
                                            </span>
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader22" runat="server" Text="Edit" Font-Names="Arial"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderStyle-Width="20px" ItemStyle-Width="20px">
                                     <ItemTemplate>
                                            <span style="float:right; padding-right:20px;">
                                                <asp:LinkButton ID="hldeletelevel4" runat="server" CssClass="deletebutton" CommandName="DELETECLAIMSUMMARY" CommandArgument='<%# (Container as GridViewRow).RowIndex %>'></asp:LinkButton>
                                                <asp:Label ID="lblID2Field" Visible="false" Text='<%# Eval("UCSID") %>' runat="server" />
                                            </span>
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader24" runat="server" Text="Delete" Font-Names="Arial"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>
                                
                                
                                
                                
                                
                                
                  </Columns>
                  
                </asp:GridView>

Open in new window

doramail05Author Commented:
got it already
<asp:GridView ID="gvClaimSummary"  HeaderStyle-BackColor="#B8A9DC"
                  AlternatingRowStyle-BackColor="#E4E0EE" HeaderStyle-ForeColor="White" 
                         BorderColor="Black" BorderWidth="1px" Width="1105px"
                         RowStyle-VerticalAlign="Top" AllowPaging="true" PageSize="10"
                  AutoGenerateColumns="false" runat="server" 
                          onrowdatabound="gvClaimSummary_RowDataBound" 
                        onpageindexchanging="gvClaimSummary_PageIndexChanging" 
                        onrowcommand="gvClaimSummary_RowCommand" onrowcreated="gvClaimSummary_RowCreated" 
                        >
                        
                        <FooterStyle CssClass="FooterStyle" />
                   <Columns>
                  
                  <asp:BoundField HeaderText="Date" DataField="Datecreated" ItemStyle-Width="140px"
                                      ReadOnly="True"
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField>
                                
                  <%--<asp:BoundField HeaderText="Category" DataField="Category" 
                                      HeaderStyle-Width="20%"
                                      ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField>  --%> 
                                
                                <asp:TemplateField HeaderStyle-Width="180px" ItemStyle-Width="205px" HeaderText="Category">
                                     <ItemTemplate>
                                     <asp:Panel ID="pnl01" runat="server">
                                        <div style="float:left;width:285px;"><asp:Label ID="lbcategory" runat="server" Visible='<%# getMultipleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") + "(+)" %>' /></div>
                                       <asp:Label ID="lblDesc" runat="server" Visible="true"><div style="float:left;margin-left:3px;width:200px;"><%# Eval("Description") %></div></asp:Label>
                                       <asp:Label ID="lblDetails" runat="server" Visible="true"><div style="float:left;margin-left:60px;width:200px;"><%# Eval("Detail") %></div></asp:Label>
                                       <asp:Label ID="lblsubtotal" runat="server" Visible="true"><div style="float:left;margin-left:37px;width:100px;"><%# Eval("Subtotal") %></div><div style="clear:both;"></div></asp:Label>
                                        </asp:Panel>
                                        <asp:Label ID="lblcategory" runat="server" Visible='<%# getSingleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") %>' />
                                        <br />
                                         <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" ExpandedText="asasddsa"  ExpandControlID="pnl01" CollapseControlID="pnl01" TargetControlID="panelmultiplecategory" Collapsed="true"></asp:CollapsiblePanelExtender>    
                                     
                                     <asp:Panel ID="panelmultiplecategory" runat="server" Width="830px"> 
                                         <asp:GridView ID="gvClaimSummaryMini" HeaderStyle-BackColor="#B8A9DC" 
                                          AlternatingRowStyle-BackColor="#E4E0EE" RowStyle-BackColor="White" HeaderStyle-ForeColor="White" 
                                                ShowHeader="false" BorderColor="Black" BorderWidth="0px" Width="900px" 
                                                 RowStyle-VerticalAlign="Top" AllowPaging="true" PageSize="10" AutoGenerateColumns="false" runat="server">
                                          <Columns>
                                            <asp:BoundField DataField="Categoryname" ItemStyle-Width="390px" HeaderText="Category" ReadOnly="true" />
                                            <asp:BoundField DataField="Description" ItemStyle-Width="350px" HeaderText="Description" ReadOnly="true" />
                                            <asp:BoundField DataField="Details" ItemStyle-Width="320px" HeaderText="Details" ReadOnly="true" />                                              <asp:TemplateField ItemStyle-Width="150px">
                                                 <ItemTemplate><asp:Label ID="lblAmountField" Visible="false" Text='<%# Eval("Amount") %>' runat="server" /><%# GetUnitPrice(decimal.Parse(Eval("Amount").ToString())).ToString("N2") %></ItemTemplate>
                                            </asp:TemplateField>
                                          </Columns>
                                         </asp:GridView>
                                     
                                     </asp:Panel>
                                     
                                     </ItemTemplate>
                                </asp:TemplateField>
                                
                                <%--<asp:TemplateField HeaderStyle-Width="100px">
                                     <ItemTemplate>
                                            
                                                <asp:Label ID="lblIDField" Visible='<%# getSingleVisibility(Eval("Category").ToString()) %>' Text='<%# Eval("Category") %>' runat="server" />
                        <asp:HyperLink ID="hp01" runat="server" Visible='<%# getMultipleVisibility(Eval("Category").ToString()) %>' Text="Multiple" />
                        
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader" runat="server" Text="Category" Font-Names="Times"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>--%>
                                
                                  <%--<asp:BoundField HeaderText="Amount" DataField="Amount" 
                                      HeaderStyle-Width="20%"
                                      ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>  
                                
                                <%--<asp:BoundField HeaderText="Description" DataField="Description" 
                                      HeaderStyle-Width="40%"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>
                                
                                 <asp:BoundField HeaderText="Description" DataField="Description" 
                                     ItemStyle-Width="290px" HeaderStyle-Width="290px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                 <asp:BoundField HeaderText="Details" DataField="Detail" 
                                     ItemStyle-Width="270px" HeaderStyle-Width="270px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                 <asp:BoundField HeaderText="Subtotal" DataField="Subtotal" 
                                       ItemStyle-Width="120px" HeaderStyle-Width="120px"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> 
                                
                                
                                
                                <%--<asp:BoundField HeaderText="Status" DataField="Status" 
                                      HeaderStyle-Width="20%"
                                     ReadOnly="True"  
                                    HeaderStyle-HorizontalAlign="Left"  ItemStyle-HorizontalAlign="Left">
                                    <HeaderStyle  ForeColor="White"></HeaderStyle>
                                    
                                </asp:BoundField> --%>
                                
                                <asp:TemplateField HeaderStyle-Width="40px" ItemStyle-Width="40px">
                                     <ItemTemplate>
                                            <span style="float:right; padding-right:20px;">
                                                <asp:LinkButton ID="hledit5" runat="server" CssClass="viewbutton" CommandName="EDITCLAIMSUMMARY" CommandArgument='<%# (Container as GridViewRow).RowIndex %>'></asp:LinkButton>
                                                <asp:Label ID="lblID3Field" Visible="false" Text='<%# Eval("UCSID") %>' runat="server" />
                                                <asp:Label ID="lblCateField" Visible="false" Text='<%# Eval("Category") %>' runat="server" />
                                            </span>
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader22" runat="server" Text="Edit" Font-Names="Arial"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>
                                
                                <asp:TemplateField HeaderStyle-Width="40px" ItemStyle-Width="40px">
                                     <ItemTemplate>
                                            <span style="float:right; padding-right:20px;">
                                                <asp:LinkButton ID="hldeletelevel4" runat="server" CssClass="deletebutton" CommandName="DELETECLAIMSUMMARY" CommandArgument='<%# (Container as GridViewRow).RowIndex %>'></asp:LinkButton>
                                                <asp:Label ID="lblID2Field" Visible="false" Text='<%# Eval("UCSID") %>' runat="server" />
                                            </span>
                                        </ItemTemplate>
                                         <HeaderTemplate>
                                        <span style="float:right; padding-right:12px;">
                                         <asp:Label ID="lblheader24" runat="server" Text="Delete" Font-Names="Arial"  ForeColor="White" />
                                        </span>
                                    </HeaderTemplate>
                                        
                                </asp:TemplateField>
                                
                                
                                
                                
                                
                                
                  </Columns>
                  
                </asp:GridView>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.