Column style (list) with ellipsis and tooltip

Build 1501 on 14/Nov/2017  This topic last edited on: 6/Sep/2016, at 13:33

This column displays the title, in 300 units width, using "Title" sort, and if the title is longer, the ellipsis is added at the end. The tooltip, if you hover the mouse above the title, always shows full title.

<ColStyle Name="Title" Width="300" Height="0" SortName="Title">

  <CellTemplate>

    <xp:TextBlock TextTrimming="WordEllipsis" Margin="4,0,4,0" VerticalAlignment="Top" HorizontalAlignment="Left"

       Text="{Binding Path=[folderObject.title]}">

      <xp:TextBlock.ToolTip>

        <TextBlock Text="{Binding Path=[folderObject.title]}" MaxWidth="300" TextWrapping="Wrap"/>

      </xp:TextBlock.ToolTip>

    </xp:TextBlock>

  </CellTemplate>

</ColStyle>

The second example use the DataTemplate for the same purpose as above, but shown in a grid

<DataTemplate>

 <xp:TextBlock TextTrimming="WordEllipsis" Margin="4,0,4,0" VerticalAlignment="Top" HorizontalAlignment="Left"

                 Text="{Binding Path=[folderObject.title]}">

                 <xp:TextBlock.ToolTip>

           <TextBlock Text="{Binding Path=[folderObject.title]}" MaxWidth="300" TextWrapping="Wrap"/>

   </xp:TextBlock.ToolTip>

  </xp:TextBlock>

</DataTemplate>