我有这段代码,它基本上将一个gridview 放置在gridview 的单元格下方 - 一种分层类型的显示。
但是,子网格视图看不到数据上下文。
我已经搜索并尝试了很多案例,但它不起作用。我的程序现在抱怨在绑定过程中发生死锁并崩溃......我不知道如何让我的子网格看到数据绑定......
<telerik:RadGridView Height="633" HorizontalAlignment="Left" Margin="301,0,0,0" Name="radGridView2" VerticalAlignment="Top" Width="1546" Grid.Row="1" ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" ItemsSource="{Binding Collections}" BorderBrush="#FFD7D2D2" FontFamily="Mangal" FontSize="14" Loaded="radGridView2_Loaded" AutoGenerateColumns="False"
RowStyleSelector="{StaticResource rowStyleSelector}" GroupRenderMode="Flat" ShowColumnSortIndexes="True" CanUserFreezeColumns="False" CanUserResizeColumns="False">
<telerik:RadGridView.Columns>
<telerik:GridViewToggleRowDetailsColumn />
<telerik:GridViewDataColumn DataMemberBinding="{Binding SetToPending}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding CollectionId}" ToolTip="{Binding Notes}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding CollectionDate, Converter={StaticResource dateConverter}}"/>
<telerik:GridViewDataColumn DataMemberBinding="{Binding IsAdvancedPayment}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding LocationId}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding LocationName}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding NumMachines}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding NumCollections}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Gross}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding OperatorCommission}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Actual}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding OverShort}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Advance}" ToolTip="{Binding AdvanceId}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding TotalActualIn}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding TotalActualOut}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Gross}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding LocationCommission}" />
<telerik:GridViewDataColumn DataMemberBinding="{Binding Notes}" />
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowDetailsTemplate>
<DataTemplate>
<telerik:RadGridView ItemsSource="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" Name="childGrid" ShowGroupPanel="False">
</telerik:RadGridView>
</DataTemplate>
</telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>