質問編集履歴
2
XAMLの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -15,3 +15,49 @@
|
|
15
15
|
|
16
16
|
|
17
17
|
イメージとしては、カラム、行を指定して、そのText内容を得るのかなと思ったのですが、どなたか、値の取得方法を教えてください....
|
18
|
+
|
19
|
+
下記にXAMLを記載します※追記
|
20
|
+
|
21
|
+
<DataGrid x:Name="dataGrid" AutoGenerateColumns="False" Margin="85,195,76,222" Grid.Column="1" RowHeaderWidth="0" PreviewKeyDown="kpDetaGrid_check" >
|
22
|
+
|
23
|
+
<DataGrid.ColumnHeaderStyle>
|
24
|
+
|
25
|
+
<Style TargetType="DataGridColumnHeader">
|
26
|
+
|
27
|
+
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
28
|
+
|
29
|
+
</Style>
|
30
|
+
|
31
|
+
</DataGrid.ColumnHeaderStyle>
|
32
|
+
|
33
|
+
<DataGrid.Columns>
|
34
|
+
|
35
|
+
<DataGridTextColumn Header="Number"
|
36
|
+
|
37
|
+
Binding="{Binding BinNumber }"
|
38
|
+
|
39
|
+
Width="80.008"/>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
<DataGridTextColumn Header="Name"
|
44
|
+
|
45
|
+
Binding="{Binding BinName}"
|
46
|
+
|
47
|
+
Width="79.34"
|
48
|
+
|
49
|
+
IsReadOnly="True" />
|
50
|
+
|
51
|
+
</DataGrid.Columns>
|
52
|
+
|
53
|
+
<DataGrid.CellStyle>
|
54
|
+
|
55
|
+
<Style TargetType="DataGridCell">
|
56
|
+
|
57
|
+
<Setter Property="Height" Value="25" />
|
58
|
+
|
59
|
+
</Style>
|
60
|
+
|
61
|
+
</DataGrid.CellStyle>
|
62
|
+
|
63
|
+
</DataGrid>
|
1
ソースの箇所を変更しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
|
12
12
|
|
13
|
-
((TextBox)dataGrid.Columns[columnIndex].GetCellContent(dataGrid.SelectedItem)).Text;
|
13
|
+
string dgtext = ((TextBox)dataGrid.Columns[columnIndex].GetCellContent(dataGrid.SelectedItem)).Text;
|
14
14
|
|
15
15
|
|
16
16
|
|