当单元格内容被截断时,将 VB.Net DataGridView 中的三个点(省略号)(...) 更改为自定义字符
我正在 VB.Net 中开发一个项目,并且使用古吉拉特语字体(非 Unicode)。
我放置了一个 DaraGridView (DGV) 并在 DGV 中显示数据库中存储的数据。
在 DGV 中,如果单元格的内容被截断,则 DGV 显示椭圆(三个点)(...);但由于字体设置为古吉拉特语字体,它会显示古吉拉特语字母“ઈઈઈ”而不是“...”,因为古吉拉特语字符“ઈ”是用英文“.”编码的。 (点)字符。
在古吉拉特语字体中,“.”可以用英文字符“P”生成。
那么,如何将省略号更改为英文“P”字符?或者如何完全删除省略号?
我在 2010 年 8 月 31 日星期二下午 1:33 找到了 berc 的类似解决方案: http://social.msdn .microsoft.com/Forums/en-US/winforms/thread/95c8963f-9832-4e2d-b057-3590afe3b65d
但我不确定这是完美的和/或唯一的方法,而且它会是否真的有效。 如果上述 MSDN 链接上的解决方案很好,我可以从中删除多少代码和/或我需要更多代码才能使其完全工作?
I am developing a project in VB.Net and I am using Gujarati fonts (non-Unicode).
I have placed a DaraGridView (DGV) and displaying the data stored in database in DGV.
In DGV, if the contents of the cell is truncated, the DGV shows ellipses (three dots) (...); but as the font is set to a Gujarati font, it displays a Gujarati alphabet "ઈઈઈ" instead of "..." because the Gujarati character "ઈ" is coded with the English "." (dot) character.
In Gujarati font, "." can be generated with the English character "P".
So, How can I change the ellipses to English "P" character? OR How can I remove the ellipses completely?
I have found a similar solution by berc on Tuesday, August 31, 2010 1:33 PM :
http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/95c8963f-9832-4e2d-b057-3590afe3b65d
but I am not sure it is the perfect and/or the only way to do so, AND it will really work or not.
If the solution on the above link of MSDN is fine, how much code from it I can remove and/or will I need more code to get it work fully?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以覆盖
CellFormatting
事件:You can override the
CellFormatting
event:哇,效果很好,谢谢:)
现在 DGV 中有一些栏目有英文字体。
因此,我插入了一些代码,如下所示,以免格式化某些特定单元格
Wow, it worked fine, thanks :)
Now there are some columns in DGV having English font.
So, I inserted some code as following to not to format some specific cells