This question is locked. New answers and comments are not allowed.
Hi,
I have a column that contains a ListBox. The DataTemplate for the listbox contains a couple of controls, one of which is a TextBlock. I want to have contents of the TextBlock wrap. So to make that occur I determined that I had to set the width to a specific value. However, that creates a problem when the user resizes the column. How can I have the text in the TextBlock wrap AND resize when the user changes the width of the column?
The code I am using is :
Thanks
Jerry
I have a column that contains a ListBox. The DataTemplate for the listbox contains a couple of controls, one of which is a TextBlock. I want to have contents of the TextBlock wrap. So to make that occur I determined that I had to set the width to a specific value. However, that creates a problem when the user resizes the column. How can I have the text in the TextBlock wrap AND resize when the user changes the width of the column?
The code I am using is :
<ListBox Margin="0,5,0,0" x:Name="lstComments" BorderBrush="Transparent" > <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Vertical"> <TextBlock TextWrapping="Wrap" Width=70 Text="{Binding Path=LayoutAnnotation.ANNOTATION.ANNOTATION1}"// tried this it did not handle resizing // Width="{Binding ElementName=lstComments, Path=ActualWidth, Converter={StaticResource /// AddConverter}, ConverterParameter=-15}"// /> ... </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>Thanks
Jerry
