This question is locked. New answers and comments are not allowed.
mike massing
Top achievements
Rank 1
mike massing
asked on 30 Apr 2009, 04:04 AM
Hi Telerik team,
Iam in need of a feature, where both the header-text and the grid view columns need to be wrapped, in case of a lengthier data.
I went through the forums, and implemented the wrap feature as mentioned in the below link:
But the problem is that the lengthier data is not wrapped unless i manually resize the particular column. I tried with a custom cell style for the gridview columns and having a textblock defined in it with a minimal width, but still iam helpless...
Could you pls investigate this and respond back at the earliest, as this is a blocking issue to my projects?
Please Let me know if you need a support ticket for the same?
Regards
Mike
3 Answers, 1 is accepted
0
Hi mike massing,
If I understood correctly, you managed to set-up the HeaderCellStyle to wrap by following the forum thread, but you would like to do the same for the actual cell content. Please, let me know if that is not the case.
The GridViewDataColumn class has a property TextWrapping which you could set to Wrap in order to achieve what you need. I have modified the project from the forum thread you mention and turned TextWrapping on. Please, examine the project and let me know if that is not what you would like to achieve. Here if my little modification to the original project of my colleague:
I am using version which is 2009.1.413.1020
In case this is not what you need, you can help us a lot if you send us a sample dummy/stub project with your particular setup and tell us the exact steps to reproduce what you are experiencing and what you expect the correct behavior to be.
Thank you in advance. I am looking forward to hearing from you.
Regards,
Ross
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.
If I understood correctly, you managed to set-up the HeaderCellStyle to wrap by following the forum thread, but you would like to do the same for the actual cell content. Please, let me know if that is not the case.
The GridViewDataColumn class has a property TextWrapping which you could set to Wrap in order to achieve what you need. I have modified the project from the forum thread you mention and turned TextWrapping on. Please, examine the project and let me know if that is not what you would like to achieve. Here if my little modification to the original project of my colleague:
| <UserControl x:Class="HeaderTextWrapping.Page" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" |
| xmlns:GridView="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"> |
| <Grid x:Name="LayoutRoot" Background="White"> |
| <telerik:RadGridView Name="RadGridView1"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn TextWrapping="Wrap" UniqueName="Sender" HeaderText="Wrapped Header Column Text" Width="150"> |
| <telerik:GridViewDataColumn.HeaderCellStyle> |
| <Style TargetType="GridView:GridViewHeaderCell"> |
| <Setter Property="Template" Value="{StaticResource WrappedGridViewHeaderCellTemplate}" /> |
| </Style> |
| </telerik:GridViewDataColumn.HeaderCellStyle> |
| </telerik:GridViewDataColumn> |
| </telerik:RadGridView.Columns> |
| </telerik:RadGridView> |
| </Grid> |
| </UserControl> |
I am using version which is 2009.1.413.1020
In case this is not what you need, you can help us a lot if you send us a sample dummy/stub project with your particular setup and tell us the exact steps to reproduce what you are experiencing and what you expect the correct behavior to be.
Thank you in advance. I am looking forward to hearing from you.
Regards,
Ross
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
mike massing
Top achievements
Rank 1
answered on 02 May 2009, 03:50 AM
Hi Ross,
Thanks for your reply and sample.
But, unfortunately, it does not suit my needs. May be, iam not specific with the problem statement. To make things clear, let me re-iterate the problem statement.
With reference to the code snippet below, the problem is that, though the wrapping is defined for the header, a proper width is specified (150) and cell style for a gridviewcell contains a textblock with a defnite width(100) and wrapping set, the wrapping does not happen, i.e., when the grid is re-sized manually, the textblock is stripped off its edges.
But, things are okay on the datacolumns where the cellstyle is not defined. Pls let me know if i need to specify any additional attributes to make the wrapping happen on the cell-style.
If you are still not getting my point, i shall attach a sample to demonstrate the behaviour.
<Controls:GridViewDataColumn HeaderText="" Width="150" TextWrapping="Wrap" HeaderCellStyle="{StaticResource wrapstyle}" UniqueName="friendlyname" IsGroupable="True">
<Controls:GridViewDataColumn.CellStyle>
<Style TargetType="telerikGridView:GridViewCell">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="telerikGridView:GridViewCell">
<Border BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}">
<StackPanel Margin="10" Orientation="Horizontal">
<TextBlock x:Name="tbfriendlyname" Width="100" Text="{Binding friendlyname}" TextWrapping="Wrap" />
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Controls:GridViewDataColumn.CellStyle>
</Controls:GridViewDataColumn>
Regards
Mike
0
Hello mike massing,
I am not sure what you mean by "the textblock is stripped off its edges." Does this mean that when you try to shrink the column at some point the textblocks do not wrap? If that is the case this is natural behavior when you set a specific size to a textblock.
Could you please send us a project where the problem that you are describing is visible?
Best wishes,
Milan
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.
I am not sure what you mean by "the textblock is stripped off its edges." Does this mean that when you try to shrink the column at some point the textblocks do not wrap? If that is the case this is natural behavior when you set a specific size to a textblock.
Could you please send us a project where the problem that you are describing is visible?
Best wishes,
Milan
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.