GridWeb とそのヘッダー バーのサイズを変更する
Contents
[
Hide
]
GridWeb を Web フォームに追加するでは、WYSIWYG を使用した Aspose.Cells.GridWeb コントロールのサイズ変更について説明しました。この記事では、実行時に Aspose.Cells.GridWeb API を使用して同じことを行う方法について説明します。また、データを読みやすくするために Aspose.Cells.GridWeb コントロールのヘッダー バーのサイズを変更する方法についても説明します。
Aspose.Cells.GridWeb の幅と高さを変更する
Aspose.Cells.GridWeb コントロールの幅と高さを変更することは、単純ですが重要な機能です。 Aspose.Cells.GridWeb コントロールは、API の GridWeb クラスによって表されます。GridWeb コントロールの幅と高さを変更するには、幅と高さのプロパティを使用します。
コントロールの幅と高さは、ピクセルまたはポイントで定義できます。
次のコード スニペットの出力を以下に示します。
GridWeb コントロールの幅と高さを変更
This file contains hidden or 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 コントロールには、次の 2 つのヘッダー バーが含まれています。
- 上部のヘッダー バー。このヘッダー バーは列を A 、 B 、 C 、 D などとして表します。
- 左のヘッダー バー。このヘッダー バーは行を 1 、 2 、 3 、 4 などとして表します。
これらのヘッダー バーの両方を以下に示します。
ヘッダーバー
GridWeb コントロールの HeaderBarHeight プロパティと HeaderBarWidth プロパティをそれぞれ使用して、上部のヘッダー バーの高さと左側のヘッダー バーの幅を変更します。次の図は、次のコード例の出力を示しています。
ヘッダーバーの幅と高さを変更
This file contains hidden or 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); |