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

GridViewDataColumn carriage returns

2 Answers 135 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
krisdoff
Top achievements
Rank 1
krisdoff asked on 07 Feb 2012, 10:54 AM
Hi there,

I have data that contains carriage returns, I want the cell to visually truncate the text instead of expanding the row vertically to accommodate it.  What are my options?

Many thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 07 Feb 2012, 11:09 AM
Hi Chris,

 

Have you checked this thread "Truncate display text in cell"



Kind regards,
Vanya Pavlova
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
krisdoff
Top achievements
Rank 1
answered on 07 Feb 2012, 03:20 PM

Great thanks; I elected to do the follwing:

 

 

<telerik:GridViewDataColumn.CellEditTemplate>

 

<DataTemplate>

 

<TextBox AcceptsReturn="True" MaxHeight="250" Width="300" Text="{Binding Path=Value,Mode=TwoWay}"/>

 

</DataTemplate>

 

</telerik:GridViewDataColumn.CellEditTemplate>

 

<telerik:GridViewDataColumn.CellTemplate>

 

<DataTemplate>

 

<TextBlock MaxHeight="18" Width="300" TextWrapping="NoWrap" Text="{Binding Path=Value}"/>

 

</DataTemplate>

 

</telerik:GridViewDataColumn.CellTemplate>

Tags
GridView
Asked by
krisdoff
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
krisdoff
Top achievements
Rank 1
Share this question
or