DataGridViewTextBoxColumn中的长字符串 - 显示结束,而不是开始

时间:2015-09-02 20:41:48

标签: c# vb.net winforms datagridview alignment

如何调整或继承 DataGridViewTextBoxColumn ,以便字符串结尾可见?当前的行为是,即使右对齐,字符串的左侧部分也是可见的(如果字符串太长)。

拥有示例文件路径:

D:\Data\Visual Studio 2015\Projects\WindowsApplication1\filename.txt

DataGridViewTextBoxColumn 中,它看起来像

+----------------------------------+
|DataGridViewTextBoxColumn1        |
+----------------------------------+
|D:\Data\Visual Studio 2015\Project|   <-- left-aligned long value - OK
|D:\Data\Visual Studio 2015\Project|   <-- right-aligned long value - CURRENT BEHAVIOR
|s\WindowsApplication1\filename.txt|   <-- I NEED RIGHT ALIGNMENT LIKE THIS
+----------------------------------+

→ View the above as graphics.

(C#或VB - 无论你喜欢什么。)

1 个答案:

答案 0 :(得分:1)

使用此主题中的sizeof类:

https://stackoverflow.com/a/29516395/904156