码迷,mamicode.com
首页 > Web开发 > 详细

silverlight RadGridView 复合表头 多表头

时间:2015-09-15 19:49:25      阅读:335      评论:0      收藏:0      [点我收藏+]

标签:

<telerik:RadGridView x:Name="GridView" Grid.Row="3" ShowGroupPanel="False"
RowIndicatorVisibility="Collapsed" CanUserFreezeColumns="False"
IsReadOnly="True" IsFilteringAllowed="False"
FrozenColumnsSplitterVisibility="Collapsed" AutoGenerateColumns="False" CanUserResizeColumns="False" >
<telerik:RadGridView.Columns>

<rowindex:RowIndexColumn Width="30" ColumnGroupName="rowindex" PageIndex="{Binding PageIndex,ElementName=DataPager}" PageSize="{Binding PageSize,ElementName=DataPager}" Header="序号"></rowindex:RowIndexColumn>

<telerik:GridViewDataColumn Header="区县" Width="80" DataMemberBinding="{Binding RegionName}"
ShowDistinctFilters="True" TextAlignment="Left">
</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn Header="企业名称" Width="200" DataMemberBinding="{Binding PsName}"
ShowDistinctFilters="True" TextAlignment="Left" >
</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn Header="监测点名称" Width="150" DataMemberBinding="{Binding OutputName}"
ShowDistinctFilters="True" TextAlignment="Left" >
</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn Header="监测时间" Width="150"
DataMemberBinding="{Binding MonitorTime}"
ShowDistinctFilters="True" TextAlignment="Center" />

<telerik:GridViewDataColumn Width="400" ShowDistinctFilters="True" >
<telerik:GridViewDataColumn.Header>
<Grid Width="400">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="1"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="化学需氧量(mg/l)" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Rectangle Fill="#FF9DBBDD" HorizontalAlignment="Stretch" Height="1" Grid.Row="1"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="0" Grid.Column="0"/>
<TextBlock Grid.Column="1" Text="原始浓度" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="1" Grid.Column="2"/>
<TextBlock Grid.Column="3" Text="修正浓度" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="1" Grid.Column="4"/>
<TextBlock Grid.Column="5" Text="数据状态" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="0" Grid.Column="6"/>
</Grid>
</Grid>
</telerik:GridViewDataColumn.Header>

<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
</Grid.ColumnDefinitions>

<TextBlock Grid.Column="0" Text="{Binding StrengthYS1,Converter={StaticResource DecimalConverter}}" Tag="StrengthYS1" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" Height="25" Width="1" Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,-3,0" />
<TextBlock Grid.Column="1" Text="{Binding Strength1,Converter={StaticResource DecimalConverter}}" Tag="DecimalConverter" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" Height="25" Width="1" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,-5,0" />
<TextBlock Grid.Column="2" Text="{Binding DataAvailable1}" HorizontalAlignment="Center" Tag="DataAvailable1" VerticalAlignment="Center"></TextBlock>
</Grid>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>

<telerik:GridViewDataColumn Width="400" ShowDistinctFilters="True" >
<telerik:GridViewDataColumn.Header>
<Grid Width="400">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="1"></RowDefinition>
<RowDefinition Height="30"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Text="氨氮(mg/l)" HorizontalAlignment="Center" VerticalAlignment="Center" />
<Rectangle Fill="#FF9DBBDD" HorizontalAlignment="Stretch" Height="1" Grid.Row="1"/>
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="1"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="0" Grid.Column="0"/>
<TextBlock Grid.Column="1" Text="原始浓度" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="1" Grid.Column="2"/>
<TextBlock Grid.Column="3" Text="修正浓度" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="1" Grid.Column="4"/>
<TextBlock Grid.Column="5" Text="数据状态" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" VerticalAlignment="Stretch" Width="0" Grid.Column="6"/>
</Grid>
</Grid>
</telerik:GridViewDataColumn.Header>

<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
<ColumnDefinition Width="3*"></ColumnDefinition>
</Grid.ColumnDefinitions>

<TextBlock Grid.Column="0" Text="{Binding StrengthYS2,Converter={StaticResource DecimalConverter}}" Tag="StrengthYS2" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" Height="25" Width="1" Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,-3,0" />
<TextBlock Grid.Column="1" Text="{Binding Strength2,Converter={StaticResource DecimalConverter}}" Tag="Strength2" HorizontalAlignment="Right" VerticalAlignment="Center"></TextBlock>
<Rectangle Fill="#FF9DBBDD" Height="25" Width="1" Grid.Column="1" HorizontalAlignment="Right" Margin="0,0,-5,0" />
<TextBlock Grid.Column="2" Text="{Binding DataAvailable2}" Tag="DataAvailable2" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
</Grid>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>

</telerik:GridViewDataColumn>

 

......

 

技术分享

silverlight RadGridView 复合表头 多表头

标签:

原文地址:http://www.cnblogs.com/gucheng/p/4810983.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!