回答編集履歴

2

説明の補足

2018/09/28 10:10

投稿

kenshirou
kenshirou

スコア772

test CHANGED
@@ -1,6 +1,6 @@
1
1
  dataGridView1のCellValueChangedイベントハンドラの追加はFormのロードイベント内で行う、というのはどうでしょうか?
2
2
 
3
- (ロード完了前はイベントが発生しない)
3
+ (ロード完了前はdataGridView1のCellValueChangedイベントは動作しない)
4
4
 
5
5
  ```C#
6
6
 

1

具体的なコードの記載

2018/09/28 10:10

投稿

kenshirou
kenshirou

スコア772

test CHANGED
@@ -2,4 +2,18 @@
2
2
 
3
3
  (ロード完了前はイベントが発生しない)
4
4
 
5
+ ```C#
6
+
7
+ private void Form1_Load(object sender, EventArgs e)
8
+
9
+ {
10
+
11
+ //他の処理があれば記載
12
+
13
+
14
+
5
-  dataGridView1.CellValueChanged += new EventHandler(dataGridView1_CellValueChanged);
15
+ dataGridView1.CellValueChanged += new EventHandler(dataGridView1_CellValueChanged);
16
+
17
+ }
18
+
19
+ ```