是否有内置方法可以使 DevExpress XtraGrid GridView 列标题/标题对角线以节省水平空间?
我在 DevExpress GridView 中有一大堆非常窄的列,我想通过使标题文本(即使是 3-4 个字母缩写也太宽)倾斜/对角来节省列标题宽度。好吧,所以我想我可以去掉文本标题并用对角文本图片替换它们,至少如果 GridView 允许标题有足够的高度的话。
是否有任何内置方法可以仅显示旋转的文本而不采用图像方式?我不认为我是第一个尝试像这样挤出水平空间的程序员,所以这听起来不像是在流行的网格组件中支持的奇怪的事情:-)
如果不是,所以我必须这样做使用图像作为列标题,有任何相关建议或警告吗?
I have a whole bunch of very narrow columns in a DevExpress GridView and I want to save on column header width by making the caption text (which is too wide even at 3-4 letter abbreviations) slanted / diagonal. Well, so I guess I could get rid of text captions and replace them with pictures of diagonal text, at least if GridView will allow sufficient height for the header.
Is there any built-in way to just display the rotated text without going the image way? I don't think I am the first programmer out there trying to squeeze out horizontal space like that, so this doesn't sound like an outlandish thing to support in a popular grid component :-)
If not, and so I do have to use an image for column header, any relevant suggestions or warnings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
XtraGrid 不提供内置功能来以这种方式显示列标题标题。但是,这可以在 CustomDrawColumnHeader 事件处理程序中完成。我们已经发布了一个教程,展示了如何做到这一点。默认情况下,它应位于:
C:\Users\Public\Documents\DevExpress 2010.2 Demos\Components\WinForms\XtraGrid\CS\GridTutorials\GridVerticalHeaders
注意,因为此功能是使用自定义绘制实现的。这意味着这段文字只是这样画的。自定义绘制的文本不会被导出或打印。
XtraGrid does not provide a built in functionality to show column header captions this way. However, this can be done within the CustomDrawColumnHeader event handler. We have posted a tutorial showing how this can be done. By default, it should be located at:
C:\Users\Public\Documents\DevExpress 2010.2 Demos\Components\WinForms\XtraGrid\CS\GridTutorials\GridVerticalHeaders
NOTE, as this feature is implemented using custom draw. It means that this text is only painted this way. Custom drawn text won't be exported or printed.