I have my grid with star sized columns, and I need word wrapping on. However, if the columns are star sized, the wrapped text does not automatically expand the row's height to display all of the text. In the picture I have attached, the text in the second and fourth rows are supposed to say "Personal Representative", but the row's height is not expanded to show the text. If I put a hard-coded number for the column width, then the row expands its height to accomodate the text's wrap. Is there a way to have star-sized columns and word wrap?
Hi,
Thanks for reporting this, the Grid rows should be growing to the largest cells height, however, there was a bug when the column is set to star sizing.
This has been fixed and will be in the first service release.
As a side note, since your columns are set to start sizing, you should set your RowHeight to Dynamic.
Normally, what would happen is the grid would size a row to the largest cell, and that row's height will become that big, but will never become smaller than that. However, since you have text wrapping on, the rows height might look awkward in those circumstances, which is why we offer a dynamic row height, which means if the the largest cell's height changes, the row will resize, even if its smaller.
-SteveZ
I'm running into the same issue. I have two columns, first one I set the width to 200 and the second set to *, and both TextWrapping set to Wrap. I set the RowHeight of the grids property to Dynamic but the height is not resizing so the second column (which has long text) gets cut off.
Have you installed the Service Release for 9.1?
Yeap just installed it last friday and still having same issue. Is there something I have to do after installing the update?
So, the reason your text isn't resizing, is b/c of your StackPanel.
A StackPanel, when set to the Horizontal Orientation, will tell all of its children that they have Infinite Width. Which means, that they will render with their full width. Thus it'll never wrap. If you want it to wrap, while using a StackPanel, you need to set a explicit width on your TextBlock.
<StackPanel x:Name="ComboColumn" Orientation="Horizontal">
<TextBlock Text="{Binding Tooltip}" Width="200" TextWrapping="Wrap" />
</StackPanel>
This is XAML. Initially I get very wide cells and, when I resize them I don't see any wrapping until I click the cell.
<Controls:TemplateColumn Key="f_0" GroupByComparer="{StaticResource groupComparer}" >
<Controls:TemplateColumn.HeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Title 1" />
</DataTemplate>
</Controls:TemplateColumn.HeaderTemplate>
<Controls:TemplateColumn.ItemTemplate>
<TextBlock Text="{Binding f_0.Text , Mode=TwoWay}" TextWrapping="Wrap" />
<TextBlock Text="{Binding f_0.Value , Mode=TwoWay}" Visibility="Collapsed" />
</Controls:TemplateColumn.ItemTemplate>
<Controls:TemplateColumn.EditorTemplate>
<Grid x:Name="ComboColumn" >
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock x:Name="Text" Grid.Column="0" Grid.Row="0" Text="{Binding f_0.Text, Mode=TwoWay}" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap"></TextBlock>
<TextBlock x:Name="Value" Visibility="Collapsed" Text="{Binding f_0.Value, Mode=TwoWay}"></TextBlock>
<Button x:Name="btnPopup" Grid.Column="1" Grid.Row="0" HorizontalAlignment="Right" >
<Image x:Name="popupImage" />
</Button>
</Grid>
</Controls:TemplateColumn.EditorTemplate>
</Controls:TemplateColumn>
After doing some digging I found that I had to remove the reference to Infragistics.Silverlight.v9.1 and Infragistics.Silverlight.XamWebGrid.v9.1 and add them back in. The service release updated any new references to the infragistics assemblies but any projects that still had reference to the older assembly require deleting and re-adding the reference.
Can you post the xaml, so that i can test it out.
I have a problem similar to this.
I use TemplateColumn and it contains a StackPanel control which in turn contains TextBlock. It has TextWrapping="Wrap" but only wraps text when I click cell.