- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
-
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- // 1行追加
- dataGridView1.Rows.Add();
- }
-
- private void button1_Click(object sender, EventArgs e)
- {
- // コンボボックスが未選択の場合
- if (dataGridView1.Rows[0].Cells[0].Value == null)
- {
- textBox1.Text = "null";
- }
- else
- {
- textBox1.Text = dataGridView1.Rows[0].Cells[0].Value.ToString();
- }
- }
- }
- }
|