質問編集履歴

2

追記

2018/07/11 08:59

投稿

shinpass
shinpass

スコア15

test CHANGED
File without changes
test CHANGED
@@ -31,3 +31,11 @@
31
31
  上の2行でフォーカスを当てているセルは特定できたと思いますが、
32
32
 
33
33
  このセルに文字列を挿入することができません。
34
+
35
+
36
+
37
+ <DataGrid x:Name="myDataGrid" HorizontalAlignment="Left" Height="190" Margin="145,90,0,0" VerticalAlignment="Top" Width="490" SelectionChanged="DataGrid_SelectionChanged"/>
38
+
39
+
40
+
41
+ DataGrid関係のXAMLは上記だけです

1

追記

2018/07/11 08:59

投稿

shinpass
shinpass

スコア15

test CHANGED
File without changes
test CHANGED
@@ -15,3 +15,19 @@
15
15
  データの挿入方法で躓いています。
16
16
 
17
17
  いい方法はないでしょうか?
18
+
19
+
20
+
21
+
22
+
23
+ 追記
24
+
25
+ DataGridRow row = myDataGrid.ItemContainerGenerator.ContainerFromItem(myDataGrid.SelectedItem) as DataGridRow;
26
+
27
+ DataGridCell cell = myDataGrid.Columns[myDataGrid.SelectedIndex].GetCellContent(row).Parent as DataGridCell;
28
+
29
+
30
+
31
+ 上の2行でフォーカスを当てているセルは特定できたと思いますが、
32
+
33
+ このセルに文字列を挿入することができません。