MS Expression Blend:Sketchflow - 在选择主数据网格的特定行时,使用数据填充子数据网格!? [英] MS Expression Blend: Sketchflow - Populating a sub datagrid with data upon selecting a specific row of a master datagrid!?
问题描述
Hello!
Hello! I最近,我们开始使用Expression Sketchflow来构建一些用户界面设计的原型。我目前在页面顶部有一个主数据网格,我想在选择特定网格行时允许用户查看下面的子数据网格,其中填充了与该特定主数据行相关的特定数据。 I've recently started using Expression Sketchflow to prototype some user interface designs. I currently have a master datagrid at the top of the page, which I would like to allow the user when selecting a particular grid row to see a sub-datagrid below be populated with specific data relevant to that specific row of master data. 任何人都可以对这个问题有所了解吗? Could anyone shed some light on the subject!? 非常感谢。 这篇关于MS Expression Blend:Sketchflow - 在选择主数据网格的特定行时,使用数据填充子数据网格!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
推荐答案
假设你有一个嵌套的集合1 - > collection2,假设collection1有一个名为property1的属性,而collection2有一个名为property2的属性。
xaml应该遵循:
Hi,
Assuming you have a nested collection1 -> collection2, assuming collection1 has one property named property1, and collection2 has one property named property2.
The xaml should be following:
<Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource SampleDataSource}}">
<DataGrid x:Name="dg1" ItemsSource="{Binding Collection}" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Property1}" Header="Property1"/>
</DataGrid.Columns>
</DataGrid>
<DataGrid DataContext="{Binding SelectedItem, ElementName=dg1}" ItemsSource="{Binding Collection2}" >
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Property2}" Header="Property2"/>
</DataGrid.Columns>
</DataGrid>
</Grid>