-1
我的下一個XAML代碼:在設置綁定的ItemsSource DataGrid中programmaticaly
<DataGrid x:Name="some_name" AutoGenerateColumns="False">
<DataGrid.ItemsSource>
<Binding XPath="Setting/Element[@Name='...']/Field"/>
</DataGrid.ItemsSource>
<DataGrid.Columns>
<DataGridTextColumn Header="Name" Width="*" Binding="{Binding [email protected]}"/>
<DataGridTextColumn Header="Type" Width="80" Binding="{Binding [email protected]}"/>
<DataGridTextColumn Header="Count" Binding="{Binding [email protected]}"/>
<DataGridTextColumn Header="ID" Width="80" Binding="{Binding [email protected]}"/>
</DataGrid.Columns>
</DataGrid>
我如何在C#代碼中設置Binding
與XPath="Setting/Element[@Name='...']/Field"
?
謝謝你,它工作得很好=) – kodwi