質問編集履歴

2

書式改善

2017/08/22 04:22

投稿

h_dog
h_dog

スコア7

test CHANGED
File without changes
test CHANGED
@@ -28,11 +28,11 @@
28
28
 
29
29
  直後にCellFormattingイベントが走るため、値が上書きされてしまうようです。
30
30
 
31
- CellFormattingイベントを使わず実装するしかないのでしょうか?
31
+ そもそもCellFormattingイベントで値設定した際
32
32
 
33
- 何か回避策がればご教示ただければ幸いです
33
+ 表示名のみ書き換わり、DataSourceの値は不変でると理解してるのですが、、、
34
34
 
35
-
35
+ 編集開始時に定数値を表示することはできないのでしょうか?
36
36
 
37
37
 
38
38
 
@@ -44,7 +44,9 @@
44
44
 
45
45
  '編集終了後は定数を名称に変換して表示
46
46
 
47
+ Private Sub DataGridView_CellFormatting(ByVal sender As Object, _
48
+
47
- Private Sub DataGridView_CellFormatting(ByVal sender As Object, ByVal e As DataGridViewCellFormattingEventArgs) Handles H_DataGridView1.CellFormatting
49
+ ByVal e As DataGridViewCellFormattingEventArgs) Handles DataGridView.CellFormatting
48
50
 
49
51
  e.Value = "あり"
50
52
 
@@ -56,7 +58,9 @@
56
58
 
57
59
  'セル編集時は名称を定数に変換する
58
60
 
61
+ Private Sub DataGridView_CellBeginEdit(ByVal sender As Object, _
62
+
59
- Private Sub DataGridView_CellBeginEdit(ByVal sender As Object, ByVal e As DataGridViewCellCancelEventArgs) Handles DataGridView.CellBeginEdit
63
+ ByVal e As DataGridViewCellCancelEventArgs) Handles DataGridView.CellBeginEdit
60
64
 
61
65
  DataGridView.CurrentCell.Value = "1"
62
66
 

1

書式改善

2017/08/22 04:22

投稿

h_dog
h_dog

スコア7

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  ###前提・実現したいこと
2
2
 
3
- vb.netにおけるDataGridViewでの定数項目(0:なし、1:ありといった項目)ついて、
3
+ vb.netにおけるDataGridViewでの定数項目(0:なし、1:ありといった項目)ついて、
4
4
 
5
5
  セル編集時には定数を表示し、編集完了後は名称で表示する動作を実現したいと考えています。
6
6
 
@@ -36,7 +36,7 @@
36
36
 
37
37
 
38
38
 
39
- ###該当のソースコード
39
+ ###該当のソースコード(イメージ)
40
40
 
41
41
  ```vb.net
42
42