列の折り畳みを行うと指定した列は折り畳まれて表示されます。また、1レコード複数行の表示画面の場合、折り畳まれる列と重なる部分も一緒に折り畳まれて表示されます。

ExpandメソッドおよびCollapseメソッドを使用して列の展開/折り畳みを行うことができます。また、IsCollapsedプロパティを使用して、列の展開/折り畳みの状態を取得することができます。
Imports GrapeCity.Win.MultiRow
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim TextBoxCell1 As TextBoxCell = New TextBoxCell()
TextBoxCell1.Name = "TextBoxCell1"
Dim TextBoxCell2 As TextBoxCell = New TextBoxCell()
TextBoxCell2.Name = "TextBoxCell2"
Dim TextBoxCell3 As TextBoxCell = New TextBoxCell()
TextBoxCell3.Name = "TextBoxCell3"
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {TextBoxCell1, TextBoxCell2, TextBoxCell3})
End Sub
Private Sub Button1_Click_1(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If GcMultiRow1.Columns(1).IsCollapsed = True Then
GcMultiRow1.Columns(1).Expand()
Else
GcMultiRow1.Columns(1).Collapse()
End If
End Sub
using GrapeCity.Win.MultiRow;
private void Form1_Load(object sender, EventArgs e)
{
TextBoxCell textBoxCell1 = new TextBoxCell();
textBoxCell1.Name = "textBoxCell1";
TextBoxCell textBoxCell2 = new TextBoxCell();
textBoxCell2.Name = "textBoxCell2";
TextBoxCell textBoxCell3 = new TextBoxCell();
textBoxCell3.Name = "textBoxCell3";
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { textBoxCell1, textBoxCell2, textBoxCell3 });
}
private void button1_Click(object sender, EventArgs e)
{
if (gcMultiRow1.Columns[1].IsCollapsed == true)
{
gcMultiRow1.Columns[1].Expand();
}
else
{
gcMultiRow1.Columns[1].Collapse();
}
}
また、Collapseメソッドが実行された場合、次の動作になります。
- Collapseメソッドによって折り畳まれた列は、マウス操作でリサイズすることができません。列を展開する場合にはExpandメソッドを使用する必要があります。
- Collapseメソッドが実行されたセルは、Cell.VisibleプロパティがFalseに設定されます。
- Collapseメソッドが実行されたセルは、マウス操作やショートカットキーなどによって選択することができません。
- Collapseメソッドが実行されたセルの値は、クリップボードの操作(切り取り、コピー、貼り付け)を行うことができません。