This is a migrated thread and some comments may be shown as answers.

Master/Details table width increases when details table expands

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Amit
Top achievements
Rank 1
Amit asked on 09 Feb 2009, 03:09 PM
I have a Master table with 2 details table in the RAD Grid. The grid is in a table whose style has the property "table-layout:fixed" (Code below).

However, whenever I expand the master table or details table, their width seems to increase by about 20px.

Has anyone come across this? Any ideas on how to solve it?

Thanks for your help.

Amit

<table style="width:1003px; table-layout:fixed">  
            <tr> 
                <td> 
                     <telerik:RadGrid ID="dgCategoriesView" runat="server"   
                        EnableAJAX="True" Width="1003px" Skin="Ims" AutoGenerateColumns="false"   
                        EnableEmbeddedSkins="false" ImagesPath="~\Skins\Grid\Skins\Ims\Img" 
                        GridLines="None">  
 
                        <MasterTableView DataKeyNames="CTID" ShowHeader="false">  
                              
                            <DetailTables > 
                                <telerik:GridTableView runat="server" DataKeyNames="DID" HierarchyLoadMode="ServerOnDemand" Name="DTable" Width="963px" ShowHeader="false">  
                          
                                    <Columns> 
                                        <telerik:GridBoundColumn DataField="DID" UniqueName="CDID" Visible="False"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="CID" UniqueName="CID" Visible="False"></telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="Name" UniqueName="CName" HeaderText="C Name">  
                                            <ItemStyle Width="963px" HorizontalAlign="left" /> 
                                            <HeaderStyle Width="963px" HorizontalAlign="left" /> 
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                      
                                    <DetailTables> 
                                        <telerik:GridTableView runat="server" DataKeyNames="C1ID" HierarchyLoadMode="ServerOnDemand" Name="Level1Tbl" Width="923px">  
                                              
                                            <Columns> 
                                                <telerik:GridBoundColumn DataField="C1ID" UniqueName="C1ID" Visible="False"></telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="CID" UniqueName="CID" Visible="False"></telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="Name" HeaderText="C L 1" UniqueName="Name">  
                                                    <ItemStyle Width="473px" HorizontalAlign="Left" /> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="Current" DataFormatString="{0:F4}" DataType="System.Double" HeaderText="Current" UniqueName="Current">  
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M0" HeaderText="M0">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM0Sub" runat="server" Text='<%# Container.DataItem("M0") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Container.DataItem("M0Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M1" HeaderText="M1">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM1Sub" runat="server" Text='<%# Container.DataItem("M1") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxM1Red" runat="server" Text='<%# Container.DataItem("M1Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M2" HeaderText="M2">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM2Sub" runat="server" Text='<%# Container.DataItem("M2") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxM2Red" runat="server" Text='<%# Container.DataItem("M2Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M3" HeaderText="M3">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM3Sub" runat="server" Text='<%# Container.DataItem("M3") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxM3Red" runat="server" Text='<%# Container.DataItem("M3Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M4" HeaderText="M4">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM4Sub" runat="server" Text='<%# Container.DataItem("M4") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxM4Red" runat="server" Text='<%# Container.DataItem("M4Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="M5" HeaderText="M5">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxM5Sub" runat="server" Text='<%# Container.DataItem("M5") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxM5Red" runat="server" Text='<%# Container.DataItem("M5Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="Q3" HeaderText="Q3">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxQ3Sub" runat="server" Text='<%# Container.DataItem("Q3") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxQ3Red" runat="server" Text='<%# Container.DataItem("Q3Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridTemplateColumn UniqueName="Q4" HeaderText="Q4">                                          
                                                    <ItemTemplate> 
                                                        <asp:TextBox ID="TxtBxQ4Sub" runat="server" Text='<%# Container.DataItem("Q4") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                        <asp:TextBox ID="TxtBxQ4Red" runat="server" Text='<%# Container.DataItem("Q4Red") %>' ReadOnly="true" Width="45px"></asp:TextBox> 
                                                    </ItemTemplate> 
                                                    <ItemStyle Width="50px" /> 
                                                </telerik:GridTemplateColumn> 
                                            </Columns> 
                                              
                                            <DetailTables> 
                                                <telerik:GridTableView runat="server" DataKeyNames="SDID" HierarchyLoadMode="ServerOnDemand" Width="1003px">  
                                                    <Columns> 
                                                        <telerik:GridBoundColumn DataField="SDID" UniqueName="SDID" Visible="false"></telerik:GridBoundColumn> 
                                                        <telerik:GridBoundColumn UniqueName="FName" DataField="FName" HeaderText="F Name">  
                                                            <ItemStyle Width="250px" /> 
                                                        </telerik:GridBoundColumn> 
                                                    </Columns> 
                                                </telerik:GridTableView> 
                                            </DetailTables> 
                                              
                                              
                                        </telerik:GridTableView> 
                                    </DetailTables> 
                                </telerik:GridTableView> 
                            </DetailTables> 
 
                            <Columns> 
                                <telerik:GridBoundColumn Visible="false" DataField="CTID" UniqueName="CID"></telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn DataField="CTName" UniqueName="CTName" HeaderText="C Type">  
                                    <HeaderStyle Width="533px" HorizontalAlign="Left" /> 
                                    <ItemStyle Width="533px" HorizontalAlign="Left" /> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        Current  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M0  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M1  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M2  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M3  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M4  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        M5  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        Q3  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn> 
                                    <HeaderTemplate> 
                                        Q4  
                                    </HeaderTemplate> 
                                    <HeaderStyle Width="50px" /> 
                                </telerik:GridTemplateColumn> 
                           </Columns> 
                              
                        </MasterTableView> 
 
                    </telerik:RadGrid> 
                </td> 
            </tr> 
        </table> 

1 Answer, 1 is accepted

Sort by
0
Amit
Top achievements
Rank 1
answered on 10 Feb 2009, 10:23 AM
For those who are interested, I got an answer to this - set the width to 100%, and that doesnt extend the width of the master/details table.

Amit
Tags
Grid
Asked by
Amit
Top achievements
Rank 1
Answers by
Amit
Top achievements
Rank 1
Share this question
or