WPF DataGrid FrozenColumnCount="2" AreRowDetailsFrozen="True" RowDetailsVisibilityMode="Visible"

 <DataGrid ItemsSource="{StaticResource booksData}"
           EnableColumnVirtualization="True"
           EnableRowVirtualization="True"
           FrozenColumnCount="2"
           AreRowDetailsFrozen="True"
           RowDetailsVisibilityMode="Visible">
     <DataGrid.RowDetailsTemplate>
         <DataTemplate>
             <Viewbox>
                 <Image Source="{Binding ImgUrl}" Width="200" Height="500"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Stretch"/>
             </Viewbox>
         </DataTemplate>
     </DataGrid.RowDetailsTemplate>
 </DataGrid>

 

 

 

 

 

posted @ 2024-09-22 20:15  FredGrit  阅读(3)  评论(0编辑  收藏  举报