2009-09-25 87 views
1

如何在行中顯示標題而不是列並綁定數據。因此,所有綁定的值將增加列數而不是行數。如何在WPF中水平顯示listview?

ListView.View被設置爲GridView。

請幫忙。

感謝,

+0

主持人關注的標誌是行政支持,而不是獲得緊急問題的答案。 – 2009-09-25 14:08:14

回答

1

我不能想出複雜的東西,但你可以試試這個簡單的黑客:旋轉網格的頭部和單元的內容。誰知道,也許這就是你正在尋找的:)。

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
    <Grid> 
     <ListView> 
     <ListView.LayoutTransform> 
      <RotateTransform Angle="-90"/> 
     </ListView.LayoutTransform> 
     <ListView.View> 
      <GridView> 
       <GridViewColumn Header="First"> 
        <GridViewColumn.CellTemplate> 
        <DataTemplate> 
         <ContentPresenter Content="{Binding}"> 
          <ContentPresenter.LayoutTransform> 
           <RotateTransform Angle="90"/> 
          </ContentPresenter.LayoutTransform> 
         </ContentPresenter> 
        </DataTemplate> 
        </GridViewColumn.CellTemplate> 
       </GridViewColumn>    
      </GridView> 
     </ListView.View> 
     <TextBlock Text="Some Data"/> 
     <TextBlock Text="More Data"/> 
     </ListView> 
    </Grid> 
</Page> 
+0

謝謝。 讓我試試..感謝Anwaka – Ershad 2009-09-26 10:10:27