Anyone have any ideas as to how to get a XamTextEditor inside a horizontal XamDatagrid to wrap? I have tried styles without any luck. It works with a vertical grid.
Text wrapping does work in a horizontal grid. However I'm assuming you're not seeing multiple lines because either the record is physically wide enough (i.e. the logical height of the record is such that the text doesn't need to wrap) or you did not specify a (Label|Cell)Height so the logical width of the field only has enough room to show 1 line of text. The logical width of a column is always a fixed value and is never sized based on content. The following snippet shows text wrapping:
What if we need to change the cell height dynamically according to the content?
I added this under Field Settings but this doesn't work
<ig:FieldSettings CellMinHeight="60" CellWidth="50" Height="Auto" CellContentAlignment="ValueOnly" AllowResize="True" AllowEdit="True" DataItemUpdateTrigger="OnCellValueChange" SupportDataErrorInfo="True" EditorStyleSelector="{StaticResource ParameterTypeSelector}"> <ig:FieldSettings.EditorStyle> <Style TargetType="{x:Type ig:XamTextEditor}"> <Setter Property="TextWrapping" Value="Wrap" /> </Style> </ig:FieldSettings.EditorStyle>
I am using Text Blocks so using the following:
</DataTrigger> <DataTrigger Binding="{Binding Path=DataItem.Model.IsRequired}" Value="True"> <Setter Property="TextBlock.FontWeight" Value="SemiBold" /> <Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="VerticalContentAlignment" Value="Top" /> <Setter Property="TextBlock.TextAlignment" Value="Left" /> <Setter Property="TextBlock.TextWrapping" Value="Wrap" /> <!--<Setter Property="TextBlock.Padding" Value="10,0,0,0" />--> </DataTrigger>
Do you need to add details for the height explicitly in order for content to come within the width and adjust the height accordingly?
I have tried code like yours before without success.
I cut and pasted your code into a new window and ran it, it sill won't wrap for me. I am using 8.2, are you using 8.2 also?