Imports GrapeCity.Win.MultiRow
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ComboBoxCell1 As New ComboBoxCell
ComboBoxCell1.Name = "ComboBoxCell1"
ComboBoxCell1.Items.Add("東京")
ComboBoxCell1.Items.Add("名古屋")
ComboBoxCell1.Items.Add("大阪")
ComboBoxCell1.ValueAsIndex = True
GcMultiRow1.Template = Template.CreateGridTemplate(New Cell() {ComboBoxCell1})
GcMultiRow1.SetValue(0, "ComboBoxCell1", 1)
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim gcMultiRow As GcMultiRow = Me.GcMultiRow1
If TypeOf gcMultiRow.CurrentCell Is ComboBoxCell Then
MessageBox.Show(String.Format("選択されているインデックス: {0}", gcMultiRow.CurrentCell.Value))
Else
MessageBox.Show("現在のセルはComboBoxCellではありません")
End If
End Sub
using GrapeCity.Win.MultiRow;
private void Form1_Load(object sender, EventArgs e)
{
ComboBoxCell comboBoxCell1 = new ComboBoxCell();
comboBoxCell1.Name = "comboBoxCell1";
comboBoxCell1.Items.Add("東京");
comboBoxCell1.Items.Add("名古屋");
comboBoxCell1.Items.Add("大阪");
comboBoxCell1.ValueAsIndex = true;
gcMultiRow1.Template = Template.CreateGridTemplate(new Cell[] { comboBoxCell1 });
gcMultiRow1.SetValue(0, "comboBoxCell1", 1);
}
private void button1_Click(object sender, EventArgs e)
{
GcMultiRow gcMultiRow = this.gcMultiRow1;
if (gcMultiRow.CurrentCell is ComboBoxCell)
{
MessageBox.Show(string.Format("選択されているインデックス: {0}", gcMultiRow.CurrentCell.Value));
}
else
{
MessageBox.Show("現在のセルはComboBoxCellではありません");
}
}