Grid Contro控件表头中文字如何换行

xiaoforward 2015-10-30 11:52:14
大家好:
DevExpress “Grid Contorl”控件如何将控件表头中的文字换行,类似下图:

我从网上搜索了些表头换行的资料,但是达不到效果:



哪位大侠知道该怎么样设置,不胜感激!
...全文
472 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaoforward 2015-11-02
  • 打赏
  • 举报
回复
引用 3 楼 duanzi_peng 的回复:
[quote=引用 2 楼 duanzi_peng 的回复:]
html 的换行 不是 <br>么

https://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridOptionsView_AllowHtmlDrawHeaderstopic[/quote]

现在标题换行可以实现,但是利用GridCotnrol内置的导出方法导出Excel时没有换行的效果,见下图,该如何做调整?


导出代码:

private void btnExport_Click(object sender, EventArgs e)
{
//gridView1.ExportToXlsx(@"c:\123.xlsx");
gridView1.ExportToXls(@"c:\123.xls");
}
xiaoforward 2015-11-02
  • 打赏
  • 举报
回复
引用 3 楼 duanzi_peng 的回复:
[quote=引用 2 楼 duanzi_peng 的回复:]
html 的换行 不是 <br>么

https://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridOptionsView_AllowHtmlDrawHeaderstopic[/quote]

现在标题换行可以实现,但是利用GridCotnrol内置的导出方法导出Excel时没有换行的效果,见下图,该如何做调整?


导出代码:

private void btnExport_Click(object sender, EventArgs e)
{
//gridView1.ExportToXlsx(@"c:\123.xlsx");
gridView1.ExportToXls(@"c:\123.xls");
}
xiaoforward 2015-11-01
  • 打赏
  • 举报
回复
感谢大家,问题已经解决,不能在GridCotnrol设计器中直接设置Caption,需要在代码中设置才能起作用!
exception92 2015-10-30
  • 打赏
  • 举报
回复
引用 2 楼 duanzi_peng 的回复:
html 的换行 不是 <br>么
https://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridOptionsView_AllowHtmlDrawHeaderstopic
exception92 2015-10-30
  • 打赏
  • 举报
回复
html 的换行 不是 <br>么
ajianchina 2015-10-30
  • 打赏
  • 举报
回复
"Item NO" + Environment.NewLine + "序号" 这样看看呢
Ehlib 是著名的数据库连接控制,版本为5.0.13,DBgrid增强VCL控件;支持多表头,多固定列,按表头排序,支持合计列,并支持直接打印。可以和PB的ataWindow媲美。 本版本含完整源代码,支持以下 IDE: Delphi 5,6,7,2005 C++Builder 5,6 BDS 2006 (Delphi 2006, C++Builder 2006) Delphi 2007 RAD Studio 2009 (Delphi 2009, C++Builder 2009) Embarcadero RAD Studio 2010 (Delphi 2010, C++Builder 2010) 本人已在Delphi 2010运行通过,在本人编制的进销存软件应用完全正常。 注:Delphi2010里面安装不要修改bpl文件的输出路径,采用默认值,否则安装难以成功。 Version 5.0的改进: + At design-time grid can show such components as DataSource, DataSet, DataDriver in its the bottom left part. These components can be selected in object inspector by mouse clicking. It allows to find quickly and select components which is connected to the grid. + New mode - RowPanel. In this mode grid allows to show out cells of record one under another and change height of every cell separately. + Grid can have special panel of detail information for record. It is allowed to put any control from component palette on this panel. At run time, panel is hidden and user can open it by pressing on a '+' sign which is shown at the begining of every row. + Grid can scroll data smoothly and by small steps of one pixel size. Grid can scroll data smoothly vertically and horizontally. + Hot track. Grid can highlight a cell or a row under mouse cursor. + Grid can show vertical line in gradient mode between data rows and bottom part of the grid. + In mode Column.AlwaysShowEditButton grid shows EditButtons in shadow mode. It doesn't irritate eyes by big amount of edit buttons in the grid. + New property EditButtonsShowOptions is added in the Grid of type TEditButtonsShowOptionsEh. TEditButtonsShowOptionsEh = set of (sebShowOnlyForCurCellEh, sebShowOnlyForCurRowEh, sebShowOnlyWhenGridActiveEh, sebShowOnlyWhenDataEditingEh); When Column.AlwaysShowEditButton is True, this property allows to customize, in which cases it is need to show EditButtons. : See detail information

110,549

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧