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

RadGrid DetailsTable Width

1 Answer 193 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stuart
Top achievements
Rank 1
Stuart asked on 15 Dec 2011, 12:18 PM
Hi All

I have a RadGrid with a single DetailsTable.  How do I force Wrap and set a fixed width on the column of my detail table to match the full width of the master-table. I have tried alot but epxanding the Details it does not wrap and expands the masterview larger than when not expanded. The wrap is mainly for my "Narrative" col in details view.

Any ideas greatly appreciated

Thanks
Stuart

<TABLE id="Table2" style="width:922px; table-layout:fixed">
            <tr>
            <td>
                    <telerik:RadGrid ID="gvDeletedOrders" runat="server" Width=922px
            AutoGenerateColumns="False" CellSpacing="0" GridLines="None"
        Skin="Simple" ondetailtabledatabind="gvDeletedOrders_DetailTableDataBind"
                        onitemdatabound="gvDeletedOrders_ItemDataBound">
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
 
            <AlternatingItemStyle Font-Names="Verdana" Font-Size="XX-Small" Wrap="False" />
            <ItemStyle Wrap="False" />
 
<MasterTableView DataKeyNames="OrderID" Name="master" HierarchyLoadMode="Client" Width=922px >
    <NoRecordsTemplate>
        <asp:Label ID="lblNoNotes" runat="server" Font-Names="Verdana"
            Font-Size="X-Small"  Text="No Notes "></asp:Label>                
    </NoRecordsTemplate>
     
     
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
</ExpandCollapseColumn>
 
<DetailTables>
                    <telerik:GridTableView Name="Notes" Width=922px>
                     
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
                     
                    <Columns>
                     
                    <telerik:GridBoundColumn SortExpression="Narrative" HeaderText="Comment" HeaderButtonType="TextButton"
                     DataField="Narrative">                  
 
<ItemStyle Wrap="True" Width="400px"></ItemStyle>
 
                     </telerik:GridBoundColumn>
                      
                    <telerik:GridBoundColumn SortExpression="Author" HeaderText="Staff" HeaderButtonType="TextButton"
                     DataField="Author">
<ItemStyle Wrap="True" Width="100px"></ItemStyle>
                    </telerik:GridBoundColumn>
                     
                    <telerik:GridBoundColumn SortExpression="DateWritten" HeaderText="Date" HeaderButtonType="TextButton"
                                        DataField="DateWritten">
<ItemStyle Wrap="True" Width="100px"></ItemStyle>
 
                    </telerik:GridBoundColumn>
                     
                     <telerik:GridBoundColumn SortExpression="TheSender" HeaderText="Sender" HeaderButtonType="TextButton"
                                        DataField="TheSender">
<ItemStyle Wrap="True" Width="100px"></ItemStyle>
                    </telerik:GridBoundColumn>
                     
                        <telerik:GridBoundColumn SortExpression="TheRecipient" HeaderText="Recipient" HeaderButtonType="TextButton"
                                        DataField="TheRecipient">
<ItemStyle Wrap="True" Width="222px"></ItemStyle>
                    </telerik:GridBoundColumn>
  
                    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
                        <ItemStyle Font-Names="Verdana" Font-Size="XX-Small"  Wrap="True"  />
                        <AlternatingItemStyle Font-Names="Verdana" Font-Size="XX-Small" />
                        <HeaderStyle BackColor="Black" ForeColor="White" />
                            </telerik:GridTableView>
                        </DetailTables>
 
      
 
    <Columns>
 
        <telerik:GridBoundColumn DataField="OrderID"
            FilterControlAltText="Filter column1 column" HeaderText="OrderID"
            UniqueName="OrderID">
           
        </telerik:GridBoundColumn>
         
          <telerik:GridBoundColumn DataField="SalesmanName"
            FilterControlAltText="Filter column1 column" HeaderText="Salesman"
            UniqueName="SalesmanName">
            
        </telerik:GridBoundColumn>
         
         
           <telerik:GridBoundColumn DataField="RegNumber"
            FilterControlAltText="Filter column1 column" HeaderText="Reg"
            UniqueName="RegNumber">
           
        </telerik:GridBoundColumn>
         
         
                <telerik:GridBoundColumn DataField="Status"
            FilterControlAltText="Filter column1 column" HeaderText="Status"
            UniqueName="Status">
            
        </telerik:GridBoundColumn>
         
            
         
                <telerik:GridBoundColumn DataField="DateQuoteCreated"
            FilterControlAltText="Filter column1 column" HeaderText="Quote Created"
            UniqueName="DateCreated">
          
        </telerik:GridBoundColumn>
         
      <telerik:GridBoundColumn DataField="Version"
            FilterControlAltText="Filter column1 column" HeaderText="Version"
            UniqueName="Version">
           
        </telerik:GridBoundColumn>
                   
         
           <telerik:GridBoundColumn DataField="CustomerFirstname"
            FilterControlAltText="Filter column1 column" HeaderText="Customer Firstname"
            UniqueName="CustomerFirstname">
              
        </telerik:GridBoundColumn>
         
         
           <telerik:GridBoundColumn DataField="CustomerSurname"
            FilterControlAltText="Filter column1 column" HeaderText="Customer Surname"
            UniqueName="CustomerSurname">
             
              
             
        </telerik:GridBoundColumn>
         
        <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
            HeaderText="Home Phone" UniqueName="TemplateColumn">
            <ItemTemplate>
            <label><%# Eval("TheCustomer.HomePhone")%></label>
             
            </ItemTemplate>
             <HeaderStyle Width=60% />
             
        </telerik:GridTemplateColumn>
         
        <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
            HeaderText="Email" UniqueName="TemplateColumn">
            <ItemTemplate>
            <label><%# Eval("TheCustomer.EMailAddress")%></label>
             
            </ItemTemplate>
            <HeaderStyle Width=60% />
            
        </telerik:GridTemplateColumn>
         
        <telerik:GridBoundColumn DataField="NoteCount"
            FilterControlAltText="Filter column1 column" HeaderText="No. of Notes"
            UniqueName="NoteCount">
             
             
             
        </telerik:GridBoundColumn>
         
         
           <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
            HeaderText="Notes" UniqueName="TemplateColumn">
            <ItemTemplate>
             <asp:Label ID="lblNotes" runat="server" Text="Show Notes"
                    Font-Names="Verdana" Font-Size="XX-Small" Font-Underline="True"
                    ForeColor="Blue" Visible="False"></asp:Label>
             
            </ItemTemplate>
            <HeaderStyle Width=60% />
             
        </telerik:GridTemplateColumn>
         
           
      <%--     <telerik:GridBoundColumn DataField="PotentialInitialComm"
            FilterControlAltText="Filter column1 column" HeaderText="Potential Comm"
            UniqueName="PotentialInitialComm">
             
        </telerik:GridBoundColumn>--%>
         
   <%--     <telerik:GridTemplateColumn
            FilterControlAltText="Filter TemplateColumn1 column" HeaderText="Assign To"
            UniqueName="TemplateColumn1">
            <ItemTemplate>
                <asp:DropDownList ID="ddlAssignSm" runat="server" DataTextField="FullName"
                    DataValueField="SalesmanID" Font-Names="Verdana" Font-Size="XX-Small">
                </asp:DropDownList>
            </ItemTemplate>
        </telerik:GridTemplateColumn>--%>
         
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
    <ItemStyle Font-Names="Verdana" Font-Size="XX-Small" Wrap="False" />
    <HeaderStyle Font-Bold="True" Font-Names="Verdana" Font-Size="XX-Small"
        Wrap="False" />
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
             
            </td>
             
            </tr>
            </TABLE>


1 Answer, 1 is accepted

Sort by
0
Accepted
Mira
Telerik team
answered on 19 Dec 2011, 05:18 PM
Hello Stuart,

The cause of the issue is that you set the width of the master table view and the detail table view to the same value. They must differ by 31px which is the width of the expand/collapse column.
Another option is to set the only the width of the master table view in pixels and to set the width of the detail table to 100%.

I hope this helps.

All the best,
Mira
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Stuart
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or