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

[Solved] Prevent Wrapping of Grid Column?

3 Answers 143 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 04 Aug 2009, 12:36 AM
My question is how do you prevent wrapping of items in the grid. When the grid has lots of columns it causes the icons to wrap.
See http://www.creditbootcamp.com/grid_tools.png

We tried:   
<rad:GridTemplateColumn UniqueName="Tools" HeaderText="Tools" ItemStyle-Width="150">
But it did not work. Putting the icons in a table did work but caused borders to show up around the table (which we dont want).

We want the icons to stay on the same line and not to page break.


Thanks guys!!

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Aug 2009, 04:45 AM
Hello Brett,

Set the width of the column using the HeaderStyle-Width property and also set the TableLayout property of the MasterTableView to fixed as shown below and see if it helps:
aspx:
<telerik:RadGrid ID="RadGrid" DataSourceID="SqlDataSource1" runat="server"
     <MasterTableView DataSourceID="SqlDataSource1" TableLayout="Fixed"
           <Columns> 
                 ..... 
                <telerik:GridTemplateColumn HeaderText="Tools" UniqueName="Tools" HeaderStyle-Width="150px"
                       <ItemTemplate> 
                            <asp:Image ID="Image1" ImageUrl="~/Images/Image1.gif" runat="server" /> 
                            <asp:Image ID="Image2" ImageUrl="~/Images/Image2.gif" runat="server" /> 
                            <asp:Image ID="Image3" ImageUrl="~/Images/Image3.gif" runat="server" /> 
                       </ItemTemplate> 
                 </telerik:GridTemplateColumn> 
 
               ......... 

Thanks
Princy.
0
Mike
Top achievements
Rank 1
answered on 04 Aug 2009, 12:33 PM
Thank you for the response. The page layout is liquid so the table needs to span 100%. Does setting the TableLayout property effect that?
0
Dimo
Telerik team
answered on 07 Aug 2009, 07:19 AM
Hi Brett,

No TableLayout="Fixed" affects the column widths and does not prevent the MasterTableView from expanding to 100%, unless you specify explicit pixel column widths for all columns. In this case the MasterTableView will not expand in IE7.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Mike
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or