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

Reg the text wrap in gridtemplatecolumn

7 Answers 175 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dipen
Top achievements
Rank 1
Dipen asked on 23 Jan 2012, 08:09 PM
Hello,

I have a problem with the textwrap in gridtemplatecolumn,
There will be report Name field which can be around 200 characters wide. We are placing that o the gridtemplatecolumn as shown below.

 <telerik:RadGrid ID="ExpenseReportsGrid" runat="server" AutoGenerateColumns="false" GridLines="None" 
                PageSize="25" Width="800px" AllowSorting="true" AllowCustomPaging="true" AllowPaging="true" 
                OnItemDataBound="ExpenseReportsGrid_ItemDataBound"
                OnNeedDataSource="ExpenseReportsGrid_NeedDatasource">
<MasterTableView ClientDataKeyNames="Id" CommandItemDisplay="None" AllowMultiColumnSorting="false"
                DataKeyNames="Id">
<Columns>
<telerik:GridTemplateColumn UniqueName="ReportNameTempcol" HeaderText="<%$ Resources:global,lbl_ReportTitle %>"
                            SortExpression="ReportName" DataField="ReportName">
                            <ItemTemplate>
                                <asp:LinkButton runat="server" ID="ReportName" Text='<%# Eval("ReportName") %>'
                                    ForeColor="Blue"   OnClick="NavigateToSummaryView"></asp:LinkButton>                               
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
 </Columns>
</MasterTableView>
 </telerik:RadGrid>
When there is record under this column which has wide text, it is not wrapping. I tried putting ItemStyle-Wrap="true" for the template column. But it didn't work for us.

Any help to resolve this issue.

Thanks In advance,
Dipen

7 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Jan 2012, 01:33 PM
Hello Dipen,

its not wrapped because there is not any space in your label's text.

Manually handle this thing your way

or

1. Don't put the text in a label.

2. Put the label within a table and set the width of the table and/or cells so it is forced to wrap.



Thanks,
Jayesh Goyani
0
Dipen
Top achievements
Rank 1
answered on 24 Jan 2012, 04:34 PM
Hello Jayesh  ,
Thanks for your reply.
* You have mentioned that ''there is not any space in your label's text." I am not using any label here right. I am binding the text to the link button.
* Also the text is having space in the text.
Here is a sample text '123456712 3456789012 345678 90123 45678 901234 234567890 1234 123456789012 345678'.

I will try the manual way as you suggested. Is there any special solution which grid provides for such wrapping problem.

Thanks,
Dipen

0
Dipen
Top achievements
Rank 1
answered on 25 Jan 2012, 12:01 AM
Hello,
I tried that way which you suggested. Putting the table inside ItemTemplate as shown below. But it is not working for me.
<table width="100px">
 <tr>
<td width="100px">
   <asp:LinkButton runat="server" ID="ExpenseReportName" Text='<%# Eval("ExpenseReportName") %>'
               ForeColor="Blue"  OnClick="NavigateToExpenseReportSummaryView"></asp:LinkButton>
   <asp:Image ID="ProxyImg" runat="server" ImageAlign="TextTop" ImageUrl='../Resources/images/icons/delegate2.png'
               BackColor="Transparent" BorderColor="Red" Height="18px" Width="18px" CssClass="tt" />
</td>
</tr>
</table>

Any other help would be appreciated,
Thanks,
DIpen
0
Dipen
Top achievements
Rank 1
answered on 25 Jan 2012, 08:29 PM
Hello,
I havebeen trying it since 2 days. But I am not able to find solution for it. Could you suggest some solution.

Thanks,
Dipen
0
Daniel
Telerik team
answered on 27 Jan 2012, 04:02 PM
Hi Dipen,

Let me know what are the versions of both RadControls and your browser. This would help us provide more to-the-point answer.

Thanks,
Daniel
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
0
Dipen
Top achievements
Rank 1
answered on 16 May 2012, 05:54 PM
Hi Daniel,

I am using Telerik controls of version 2012.1.411.35 version
Browser Mozilla 8.0.1
I tried today.
I used Table Layout as fixed.
Tried to put Wrap =true for all columns and master table.
Tried ClipCellContentOnResize="false" EnableRealTimeResize="true"

But it is still not wrapping text.
We are using grids in many places and we need to resolve this issue.

Could you pls suggest a way to resolve this.

Thanks & regard Dipen

0
Jayesh Goyani
Top achievements
Rank 2
answered on 17 May 2012, 07:54 AM
Hello,

Try with below link.
how to wrap text in radgrid's column or label without space


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Dipen
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Dipen
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or