silverlight - datagrid样式多表头后,拉伸后表格的表格线不跟着变化
2015-01-27 14:26
357 查看
在前台设置CanUserResize属性,可以控制当前列不可拉伸状态
如下代码:
<sdk:DataGridTemplateColumn x:Name="cl1" HeaderStyle="{StaticResource TBIStyle}" CanUserResize="False">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding [totalStorage]}" Width="50" />
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [addArea]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [addXuBian]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [downArea]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [downXuBian]}" Width="80"/>
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
如下代码:
<sdk:DataGridTemplateColumn x:Name="cl1" HeaderStyle="{StaticResource TBIStyle}" CanUserResize="False">
<sdk:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding [totalStorage]}" Width="50" />
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [addArea]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [addXuBian]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [downArea]}" Width="80"/>
<Rectangle Fill="#ccc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1" />
<TextBlock Text="{Binding [downXuBian]}" Width="80"/>
</StackPanel>
</DataTemplate>
</sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>
相关文章推荐
- Silverlight DataGrid 多表头 样式实现
- silverlight-dataGrid 多表头样式控制
- 用jQuery让表格偶数行样式渐变,鼠标移上去样式变化
- 点一下某个按钮,表格样式变化。
- WPF Datagrid Header数据绑定,表头复选框实现全选、全否、部分选中,根据条目动态变化
- Silverlight中Datagrid控件自定义列头样式Demo
- silverlight - dataGrid多表头
- Silverlight中DataGrid表头和列对齐方式的设置(原创)
- Silverlight中Datagrid控件自定义列头样式Demo
- Silverlight实用窍门系列:75.Silverlight中DataGrid制作复杂表头
- Silverlight DataGrid 多重表头实现
- silverlight datagrid表头添加控件
- Silverlight中DataGrid表头和列对齐方式的设置
- ASP.NET基础教程-DataGrid表格控件-让表格多记录多列时出现滚动条并用CSS样式表锁定表头
- DataGrid让表格多记录多列时出现滚动条并用CSS样式表锁定表头
- Silverlight实用窍门系列:75.Silverlight中DataGrid制作复杂表头 推荐
- easyui tree datagrid动态添加表头和表格数据,动态弹出框,修改和删除按钮
- WPF设置DataGrid的表头样式
- 适用于IE的固定表头和列的表格样式[CSS]
- Silverlight Toolkit DataGrid - 单元格内容对齐样式