Hi
I am looking for a way to wrap text in a ValidatedDataGridTextColumn but cannot find a way to do it. So I have started down the lines of setting up a template column in the datagrid but then I have come unstuck as the statusproperty object doesn't know what to reference, as shown in the code below...
<csla:ValidatedDataGridTextColumn Binding="{Binding Path=Remarks}" Header="Remarks" Width="150" />
<data:DataGridTemplateColumn Header
="Remarks">
<data:DataGridTemplateColumn.CellTemplate
>
<DataTemplate
>
<StackPanel
>
<TextBlock Text="{Binding Path=Remarks}" Width="150" TextWrapping
="Wrap"/>
</StackPanel
>
</DataTemplate
>
</data:DataGridTemplateColumn.CellTemplate
>
<data:DataGridTemplateColumn.CellEditingTemplate
>
<DataTemplate
>
<StackPanel
>
<TextBox Name="RemarksTextBox" Text="{Binding Path=Remarks}" Width="150" TextWrapping
="Wrap"/>
<csla:PropertyStatus RelativeTargetName="RemarksTextBox" Property="Remarks" Source="{Binding Path
=Data}" />
</StackPanel
>
</DataTemplate
>
</data:DataGridTemplateColumn.CellEditingTemplate
>
</data:DataGridTemplateColumn
>
Any help would be greatly appreciated.
Many Thanks
Adam
Hi
I have managed to resolve this with setting the mode to twoway as shown below...
<data:DataGridTemplateColumn Header="Remarks">
<data:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Remarks}" Width="300" TextWrapping="Wrap"/>
</StackPanel>
</DataTemplate>
</data:DataGridTemplateColumn.CellTemplate>
<data:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<StackPanel>
<TextBox Name="RemarksTextBox" Text="{Binding Mode=TwoWay, Path=Remarks}" Width="300" TextWrapping="Wrap"/>
<csla:PropertyStatus RelativeTargetName="RemarksTextBox" Property="Remarks" Source="{Binding Path=Data}" />
</StackPanel>
</DataTemplate>
</data:DataGridTemplateColumn.CellEditingTemplate>
</data:DataGridTemplateColumn>
Hope this helps if anyone else forgets!
Adam
Copyright (c) Marimer LLC