在前台设置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>