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

[Solved] GridViewCell contents not wrapping despite TextWrapping=Wrap

2 Answers 353 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.
Greg
Top achievements
Rank 1
Greg asked on 05 Aug 2009, 05:37 PM

Hello-
I have a GridView which is being bound to an object where one of the string fields can be long enough that the text needs to wrap in the cell to be visible. I've set TextWrapping=Wrap on 1) The GridViewDataColumn in question 2)GridView.RowStyle 3) GridViewDataColumn.CellStyle. None of these result in the text wrapping in the cell, instead the content is cut off at the end of the cell. Are there any other reasons why text wrapping wouldn't work?

Thanks!
Greg

<telerikGridView:RadGridView x:Name="gridView_AuditHistory_Events"
VerticalAlignment="Top"
IsReadOnly="false"
AutoGenerateColumns="False"
ColumnsWidthMode="Fill"
RowIndicatorVisibility="Collapsed"
ShowGroupPanel="false"
IsFilteringAllowed="false"
IsEnabled="true"
Template="{StaticResource RadGridViewTemplate}"
RowStyle="{StaticResource GridViewRowStyle1}" >
<telerikGridView:RadGridView.Columns>
<telerikGridView:GridViewDataColumn HeaderText="TimeStamp" DataMemberPath="EventDateTime" Width="140" CellStyle="{StaticResource GridViewCellStyle1}"/>
<telerikGridView:GridViewDataColumn HeaderText="User Alias Causing Change" DataMemberPath="ContactAlias" Width="160" CellStyle="{StaticResource GridViewCellStyle1}"/>
<telerikGridView:GridViewDataColumn HeaderText="Event Type" DataMemberPath="EventName" Width="200" CellStyle="{StaticResource GridViewCellStyle1}"/>
<telerikGridView:GridViewDataColumn HeaderText="Additional Event Data" DataMemberPath="EventData" TextWrapping="Wrap" CellStyle="{StaticResource GridViewCellStyle1}"/>
</telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView> 

 

 

 

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Kalin Milanov
Telerik team
answered on 10 Aug 2009, 04:46 PM
Hi Greg,

Attached I am sending you a sample application in which a CellStyle is applied and the text is being wrapped. The problem seems to be in a failing TemplateBinding which handles the wrapping. This has been logged as a bug in out backlog and we will be addressing this issue in the future. Right now your easiest option is to edit the template of the cell and set the wrapping of the AlignmentContentPresenter there.

I hope you will find the sample useful. I would also like to thank you for the feedback.

Regards,
Kalin Milanov
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.
0
Greg
Top achievements
Rank 1
answered on 10 Aug 2009, 10:20 PM
That worked, thank you!
Tags
GridView
Asked by
Greg
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Greg
Top achievements
Rank 1
Share this question
or