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

Help with Row Details

2 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rayne
Top achievements
Rank 1
Rayne asked on 24 Jan 2011, 10:01 PM
I'm having trouble with my row details. How do I get text in a textblock to wrap so that the user doesn't have to scroll horizontally to view the details?

My Row Details Template is as follows:
<StackPanel Margin="8,4">
   <TextBlock Text="Description:" FontWeight="Bold" />
   <TextBlock Text="{Binding Description}" FontStyle="Italic" TextWrapping="WrapWithOverflow" />
</StackPanel>

If the Description is longer than the current width of the grid, I get scrollbars. No matter what I set the TextWrapping attribute to. How do I wrap the text to the width of the grid?

2 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 26 Jan 2011, 02:58 PM
Hello Rayne,

Generally, controls do not have any predefined sizes. Consequently, no matter that you are setting the TextWrapping property of the TextBlock, it does not know till what sizes it needs to wrap it. What you may do is to set the Width/ MaxWidth either of the StackPanel or of the TextBlock. 

Best wishes,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Rayne
Top achievements
Rank 1
answered on 26 Jan 2011, 03:03 PM
I guess there is no way for it to be fluid based on the size of the grid, so that it resizes as the user resizes the window.

I will set a width that seems appropriate. Thanks.
Tags
GridView
Asked by
Rayne
Top achievements
Rank 1
Answers by
Maya
Telerik team
Rayne
Top achievements
Rank 1
Share this question
or