首页 > 其他分享 >tip2:关于GridViewHeaderRowPresenter和GridViewRowPresenter

tip2:关于GridViewHeaderRowPresenter和GridViewRowPresenter

时间:2024-11-19 15:42:26浏览次数:1  
标签:GridViewRowPresenter blog GridViewHeaderRowPresenter img2024 3364307 202411 tip2

点击查看代码
 <Window.Resources>

     <Style x:Key="MyHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
         <Setter Property="Background" Value="BurlyWood" />
     </Style>

     <GridViewColumnCollection x:Key="gvcc">
         <GridViewColumn Width="80"
                         DisplayMemberBinding="{Binding Year}"
                         Header="Year" />
         <GridViewColumn Width="80"
                         DisplayMemberBinding="{Binding DayOfWeek}"
                         Header="Day" />

     </GridViewColumnCollection>

 </Window.Resources>
    <StackPanel>
      <GridViewHeaderRowPresenter Name="hrp"
                                  ColumnHeaderContainerStyle="{StaticResource MyHeaderStyle}"
                                  Columns="{StaticResource gvcc}" />

      <GridViewRowPresenter Columns="{StaticResource gvcc}">
          <GridViewRowPresenter.Content>
              <sys:DateTime>2005/2/1</sys:DateTime>
          </GridViewRowPresenter.Content>
      </GridViewRowPresenter>
      <GridViewRowPresenter Columns="{StaticResource gvcc}">
          <GridViewRowPresenter.Content>
              <sys:DateTime>2024/11/17</sys:DateTime>
          </GridViewRowPresenter.Content>
      </GridViewRowPresenter>
      <GridViewRowPresenter Columns="{StaticResource gvcc}">
          <GridViewRowPresenter.Content>
              <sys:DateTime>2024/11/17</sys:DateTime>
          </GridViewRowPresenter.Content>
      </GridViewRowPresenter>
  </StackPanel>

![](/i/l/?n=24&i=blog/3364307/202411/3364307-20241117203136415-940225822.png)

GridViewHeaderRowPresenter:
表格标题行呈现器
ColumnHeaderContainerStyle:
列的Style

GridViewColumnCollection : ->Columns
布局视图列的集合

GridViewRowPresenter:
表格行呈现器
![(/i/l/?n=24&i=blog/3364307/202411/3364307-20241119154223981-816311491.png)]

标签:GridViewRowPresenter,blog,GridViewHeaderRowPresenter,img2024,3364307,202411,tip2
From: https://www.cnblogs.com/iSantiago2000i/p/18550888

相关文章

  • 科研小tip2|OpenNI2环境配置(文字简要说明)
    在本栏科研小tip1中我分享了winpcap的可行安装方法,但并没有具体讲解环境配置方法,因为其他博主已经对winpcap的环境配置做了许多分享不过我个人在使用时遇到了按照步骤完成配置后,运行仍然出现提示OpenNI2.dll(OpenNI2动态库)不存在的报错,我想可能也有许多与我一样遇到这一问题的......