WPF Data grid Text Ellipsis Not working…

Aug 18, 2010 at 9:21 AM


I have a column with long user comments. I load it using following code...

<my:DataGridTextColumn Header="Message" 
                       Binding="{Binding UserMessage, Mode=OneWay}"  
        <Style TargetType="{x:Type TextBlock}" 
               BasedOn="{StaticResource {x:Type TextBlock}}"> 
               <Setter Property="TextWrapping" 
                       Value="NoWrap" /> 
               <Setter Property="TextTrimming" 
               <Setter Property="ToolTip" 
                       Value="{Binding Path=UserMessage, Mode=OneWay}"/> 

But the ellipsis wont work. The column continues to display long text of data.

Also when I set the width of the textblock explicitly to some value then the ellipsis work fine but when I resize my column it wont show any more text in it.


Isnt there a starighforward way to do this?



Vinit Sankhe.