Is there any way that you can set a cell's content to display "..." if the text is larger than the cell containing it?
Example:
Text is "Something123"
instead of showing:
|Somethin|
Show:
|Someth...|
Hello Palen,
I have logged this behavior with our developers in our tracking system, with an issue ID of 119453. I have also created a support ticket on your behalf with number CAS-98453-L9H6V5 in order to link the development issue to it so that you are automatically updated when a Service Release containing your fix is available for download.
This does work for showing the ellipsis, but unfortunately it stops the "double-click to resize column to cell content" behavior. Is there any way to have both?
Thank you for posting.
The content of the cell is set in a TextBlock. You can set a style for the TextBlock and set its TextTrimming property’s value to CharacterEllipsis so that the text is displayed as “Someth…”.
<Style x:Key="NewTextBlock" TargetType="TextBlock">
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>
This style should be applied as TextBlockStyle of the TextColumn where you want the text to be displayed with ellipsis.
<ig:XamGrid.Columns>
<ig:TextColumn Key="Description" TextBlockStyle="{StaticResource NewTextBlock}">
</ig:TextColumn>
</ig:XamGrid.Columns>
Another approach for achieving this is handling CellControlAttached event of the XamGrid, searching the visual tree for a TextBlock and set its TextTrimming property to CharacterEllipsis.
private void xamGrid1_CellControlAttached(object sender, Infragistics.Controls.Grids.CellControlAttachedEventArgs e)
{
TextBlock text = Utilities.GetDescendantFromType(e.Cell.Control, typeof(TextBlock), false) as TextBlock;
if (text != null)
text.TextTrimming = TextTrimming.CharacterEllipsis;
}
Please let me know if you have any other questions on the matter.