0
我被一些奇怪的邊框卡住了我不知道如何擺脫樣式。我想,當我做...擺脫datagrid標題邊框(在列resize grabber處)
<Setter Property="CanUserResizeColumns" Value="False" />
...它消失。但是,否則其卡在那裏是這樣的:
http://www.bitoholics.net/users/lukas/eve/datagrid-problem.png
我的風格是這樣的:
<Style TargetType="DataGrid">
<Setter Property="HorizontalGridLinesBrush" Value="{StaticResource ThemeBorderBright}" />
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource ThemeBackgroundBright}" />
<Setter Property="RowBackground" Value="{StaticResource ThemeBackgroundDataGrid1}" />
<Setter Property="AlternatingRowBackground" Value="{StaticResource ThemeBackgroundDataGrid2}" />
<Setter Property="Background" Value="{StaticResource ThemeBackgroundDataGrid3}" />
<Setter Property="BorderBrush" Value="{StaticResource ThemeBorderDark}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="SelectionMode" Value="Single" />
<Setter Property="CanUserAddRows" Value="False" />
<Setter Property="CanUserDeleteRows" Value="False" />
<Setter Property="CanUserResizeRows" Value="False" />
<Setter Property="IsManipulationEnabled" Value="False" />
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="1" Color="{StaticResource ThemeColorHighlight}" />
<GradientStop Offset="0" Color="{StaticResource ThemeColorBackgroundDark}" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Height" Value="22" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="BorderBrush" Value="{StaticResource ThemeBorderBright}" />
</Style>
我怎樣才能的作風,邊界(或只是設置其厚度爲0),或者只讓它消失?這件事讓我發瘋了!我希望我的列可以調整大小,所以我不能使用上面的「修復」。
感謝,LueTm