これは私の問題です
私はDataGridを持っていて、これが彼のソースです
var Query = from a in m.Table1
join p in m.Table2
on a.Value1 equals p.Value1
join c in m.Table3 on a.Value2 equals c.Value2
select new {
value1 = a.value1
value2 = p.value2
value3 = c.value3
value4 = a.value4
};
<DataGrid AutoGenerateColumns="False" HorizontalAlignment="Left" Margin="84,75,0,0"
Name="Grid_Exmple" Width="478" Height="219" VerticalAlignment="Top" SelectionChanged="Grid_Exmple_SelectionChanged">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding value1 }" Header="value1 " IsReadOnly="True" x:Name="dgrvalue1 " />
<DataGridTextColumn Binding="{Binding value2 }" Header="value2 " IsReadOnly="True" x:Name="dgrvalue2 " />
<DataGridTextColumn Binding="{Binding value3 }" Header="value3 " IsReadOnly="True" x:Name="dgrvalue3" />
<DataGridTextColumn Binding="{Binding value4}" Header="value4" IsReadOnly="True" x:Name="dgrvalue4" />
</DataGrid.Columns>
DataGrid 選択イベントを押したとき
private void Grid_Exmple_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Here I try To Get The properties
e.AddedItems でプロパティを確認できますが、キャストできません
((<>f__AnonymousType2<int,int?,decimal?,decimal?,string,string,string,int,string>)(((object[])(e.AddedItems))[0])).Value1
}