OK了 !! 谢谢!~ 解决了!
内部<c1:C1DataGrid>时 ItemsSource必须写【RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl, AncestorLevel=1}}"】 好像才能绑定上
eg:
- <c1:C1DataGrid x:Name="gridName" CanUserAddRows="False" IsReadOnly="True" RowDetailsVisibilityMode="Visible"
- ShowGroupingPanel="False" AutoGenerateColumns="False" CanUserGroup="False"
- ShowVerticalFreezingSeparator="Left" CanUserFreezeColumns="Left" FrozenColumnCount="0" Height="265"
- ItemsSource="{Binding OutIs,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SelectionMode="MultiRow" >
- <c1:C1DataGrid.Columns>
- <c1:DataGridTextColumn HeaderStyle="{StaticResource ColumnHeaderStl}" TextWrapping="Wrap" Header="out名" IsReadOnly="True"
- Binding="{Binding outName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
- </c1:C1DataGrid.Columns>
- <c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
- <c1:C1AdvancedFiltersBehavior/>
- </c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
- <c1:C1DataGrid.RowDetailsTemplate>
- <DataTemplate>
- <!--in Grid-->
- <c1:C1DataGrid x:Name="inGrid" Grid.Row="1" RowHeight="Auto" MinRowHeight="30" RowHeaderWidth="0"
- CanUserAddRows="False" ShowGroupingPanel="False" AutoGenerateColumns="False" CanUserGroup="False"
- ShowVerticalFreezingSeparator="Left" CanUserFreezeColumns="Left" FrozenColumnCount="0" Height="265"
- SelectionMode="MultiRow" ItemsSource="{Binding DataContext.inIsList,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl, AncestorLevel=1}}">
- <c1:C1DataGrid.Columns>
- <c1:DataGridTextColumn HeaderStyle="{StaticResource ColumnHeaderStl}" TextWrapping="Wrap" Header="in名" IsReadOnly="True"
- Binding="{Binding inValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
- </c1:C1DataGrid.Columns>
- <c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
- <c1:C1AdvancedFiltersBehavior/>
- </c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
- </c1:C1DataGrid>
- </DataTemplate>
- </c1:C1DataGrid.RowDetailsTemplate>
- </c1:C1DataGrid>
复制代码 |