1

In the DataGrid, there is a CheckBoxColumn and a TextColumn, that displays file paths:

|   |                              |
| x |C:\docs\etc\somefile.txt      |
|   |C:\programs\misc\files\2.0\oth|   <- cut off, too long
| x |                              |

I would prefer if long strings would scroll to the end, so the user can see the filename:

|   |                              |
| x |..misc\files\2.0\otherfile.zip|
|   |                              |

Is there a way to do this? Thanks

Matt
  • 5,461
  • 7
  • 36
  • 43

1 Answers1

1

Another solution could be to use a textblock in the column template. Set texttrimming to ellipsis and put the long text in the tooltip property. http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.texttrimming.aspx

If you really want the ellipsis to the left like in your example, you may need to do some code behind measuring, see Length of string that will fit in a specific width

Community
  • 1
  • 1
Tewr
  • 3,713
  • 1
  • 29
  • 43