作成日: 2017/07/31 最終更新日: 2017/07/31
文書種別
使用方法
詳細
セルの編集が終了したときに発生するCellEditEndedイベント内でAutoFitRowsメソッドを実行することで、全ての文字が表示されるように行の高さを調整することができます。
◎サンプルコード(VB)
◎サンプルコード(C#)
◎サンプルコード(VB)
Public Sub New()
InitializeComponent()
' 複数行の入力を許可
Dim tc As New GrapeCity.Windows.SpreadGrid.TextCellType()
tc.Multiline = True
GcSpreadGrid1.Columns(0).CellType = tc
End Sub
Private Sub GcSpreadGrid1_CellEditEnded(sender As Object, e As GrapeCity.Windows.SpreadGrid.SpreadCellEditEndedEventArgs) Handles GcSpreadGrid1.CellEditEnded
GcSpreadGrid1.AutoFitRows(New Integer() {GcSpreadGrid1.ActiveRowIndex})
End Sub
◎サンプルコード(C#)
public MainWindow()
{
InitializeComponent();
// 複数行の入力を許可
GrapeCity.Windows.SpreadGrid.TextCellType tc = new GrapeCity.Windows.SpreadGrid.TextCellType();
tc.Multiline = true;
gcSpreadGrid1.Columns[0].CellType = tc;
// イベントの関連付け
gcSpreadGrid1.CellEditEnded += new EventHandler(gcSpreadGrid1_CellEditEnded);
}
void gcSpreadGrid1_CellEditEnded(object sender, GrapeCity.Windows.SpreadGrid.SpreadCellEditEndedEventArgs e)
{
gcSpreadGrid1.AutoFitRows(new int[] { gcSpreadGrid1.ActiveRowIndex });
}
旧文書番号
40832