作成日: 2019/10/07 最終更新日: 2019/10/07
文書種別
使用方法
詳細
ComboListを設定したStyleを作成し、SetCellStyleメソッドでこのスタイルを適用することで、特定セルにセルボタンを表示できます。なおボタンを常に表示するには、ShowButtonsプロパティを「Always」に設定します。
以下に、セル(2, 2)に常にセルボタンを表示するコードを記載します。
◎サンプルコード(VB)
◎サンプルコード(C#)
以下に、セル(2, 2)に常にセルボタンを表示するコードを記載します。
◎サンプルコード(VB)
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
C1FlexGrid1.Styles.Add("ComboList1")
C1FlexGrid1.Styles("ComboList1").ComboList = "..." ' セルボタンを設定
C1FlexGrid1.SetCellStyle(2, 2, C1FlexGrid1.Styles("ComboList1"))
C1FlexGrid1.ShowButtons = C1.Win.C1FlexGrid.ShowButtonsEnum.Always
End Sub
Private Sub C1FlexGrid1_CellButtonClick(sender As Object, e As C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.CellButtonClick
MessageBox.Show("CellButtonClick")
End Sub
C1FlexGrid1.Styles.Add("ComboList1")
C1FlexGrid1.Styles("ComboList1").ComboList = "..." ' セルボタンを設定
C1FlexGrid1.SetCellStyle(2, 2, C1FlexGrid1.Styles("ComboList1"))
C1FlexGrid1.ShowButtons = C1.Win.C1FlexGrid.ShowButtonsEnum.Always
End Sub
Private Sub C1FlexGrid1_CellButtonClick(sender As Object, e As C1.Win.C1FlexGrid.RowColEventArgs) Handles C1FlexGrid1.CellButtonClick
MessageBox.Show("CellButtonClick")
End Sub
◎サンプルコード(C#)
private void Form1_Load(object sender, EventArgs e)
{
c1FlexGrid1.Styles.Add("ComboList1");
c1FlexGrid1.Styles["ComboList1"].ComboList = "..."; // セルボタンを設定
c1FlexGrid1.SetCellStyle(2, 2, c1FlexGrid1.Styles["ComboList1"]);
c1FlexGrid1.ShowButtons = C1.Win.C1FlexGrid.ShowButtonsEnum.Always;
}
private void c1FlexGrid1_CellButtonClick(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
MessageBox.Show("CellButtonClick");
}
{
c1FlexGrid1.Styles.Add("ComboList1");
c1FlexGrid1.Styles["ComboList1"].ComboList = "..."; // セルボタンを設定
c1FlexGrid1.SetCellStyle(2, 2, c1FlexGrid1.Styles["ComboList1"]);
c1FlexGrid1.ShowButtons = C1.Win.C1FlexGrid.ShowButtonsEnum.Always;
}
private void c1FlexGrid1_CellButtonClick(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
MessageBox.Show("CellButtonClick");
}
旧文書番号
84534