调整GridWeb及其标题栏大小
Contents
[
Hide
]
将GridWeb添加到Web表单,讨论使用所见即所得图形界面调整Aspose.Cells.GridWeb控件。本文解释了如何使用Aspose.Cells.GridWeb API在运行时执行相同操作。还解释了如何调整Aspose.Cells.GridWeb控件的标题栏大小,使其数据易于阅读。
更改Aspose.Cells.GridWeb的宽度和高度
更改Aspose.Cells.GridWeb控件的宽度和高度是一个简单但重要的功能。Aspose.Cells.GridWeb控件在API中由GridWeb类表示。要调整GridWeb控件的宽度和高度,只需使用其width和height属性。
控件的宽度和高度可以以像素或点的形式定义。
以下是代码片段的输出结果。
更改了GridWeb控件的宽度和高度
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Setting the height of GridWeb control | |
GridWeb1.Height = new Unit(200, UnitType.Point); | |
// Setting the width of GridWeb control | |
GridWeb1.Width = new Unit(520, UnitType.Point); |
更改标题栏的宽度和高度
Aspose.Cells.GridWeb控件包含以下两个标题栏:
- 顶部标题栏,该标题栏表示A,B,C,D等列。
- 左侧标题栏,该标题栏表示1,2,3,4等行。
下面显示了这两个标题栏。
标题栏
使用GridWeb控件的HeaderBarHeight和HeaderBarWidth属性分别更改顶部标题栏和左侧标题栏的高度和宽度。下图显示了以下代码示例的输出。
更改了标题栏的宽度和高度
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Setting the height of header bar | |
GridWeb1.HeaderBarHeight = new Unit(35, UnitType.Point); | |
// Setting the width of header bar | |
GridWeb1.HeaderBarWidth = new Unit(50, UnitType.Point); |