-
Hi, after update to 0.10.0 i am not able to hide DataGridColumnHeader vertical separators, I tried to set Can someone help me? Part of the code: <UserControl.Styles>
<Style Selector="DataGridColumnHeader.dtgHeader">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="AreSeparatorsVisible" Value="false"/>
<Setter Property="SeparatorBrush" Value="Transparent"/>
</Style>
<Style Selector="TextBox.LongText">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="IsReadOnly" Value="true"/>
<Setter Property="Height" Value="64"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="Image.BtnImage">
<Setter Property="Width" Value="54"/>
<Setter Property="Height" Value="54"/>
</Style>
</UserControl.Styles>
<DockPanel>
<DataGrid AutoGenerateColumns="False" Items="{Binding Scripts}" BorderThickness="0" VerticalGridLinesBrush="Transparent" GridLinesVisibility="0">
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding ScriptType, Converter={StaticResource imageConverter}}" Width="50" Height="50" Margin="15,0,10,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<DataGridColumnHeader Content="Name" Classes="dtgHeader" Width="150" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding ScriptConfiguration.Name}" Background="Transparent" IsReadOnly="true" Height="64" BorderThickness="0" FontWeight="Bold" >
<TextBox.Styles>
<Style Selector="TextBox /template/ TextPresenter">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</TextBox.Styles>
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn Width="*">
<DataGridTemplateColumn.Header>
<DataGridColumnHeader Content="Argument" Classes="dtgHeader"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding ScriptConfiguration.Arguments}" Classes="LongText"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<DataGridColumnHeader Content="Description" Classes="dtgHeader" Width="400"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding ScriptConfiguration.Description}" Classes="LongText"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I finally find solution: The part of the code creates DataGridColumnHeader inside DataGridColumnHeader, so when I set AreSeparatorsVisible property to false, it hides only child DataGridColumnHeader separator. So solution was to set DataGrid.Styles: <UserControl.Styles>
<Style Selector="DataGridColumnHeader.dtgHeader">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="AreSeparatorsVisible" Value="false"/>
</Style>
<Style Selector="TextBox.LongText">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="IsReadOnly" Value="true"/>
<Setter Property="Height" Value="64"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
<Style Selector="Image.BtnImage">
<Setter Property="Width" Value="54"/>
<Setter Property="Height" Value="54"/>
</Style>
</UserControl.Styles>
<DockPanel>
<DataGrid AutoGenerateColumns="False" Items="{Binding Scripts}" BorderThickness="0">
<DataGrid.Styles >
<Style Selector="DataGridColumnHeader">
<Setter Property="Background" Value="{DynamicResource btnAppBorderBrushColor}"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="AreSeparatorsVisible" Value="false"/>
</Style>
</DataGrid.Styles>
<DataGrid.Columns>
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding ScriptType, Converter={StaticResource imageConverter}}" Width="50" Height="50" Margin="15,0,10,0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<DataGridColumnHeader Content="Name" Classes="dtgHeader" Width="150" />
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding ScriptConfiguration.Name}" Background="Transparent" IsReadOnly="true" Height="64" BorderThickness="0" FontWeight="Bold" >
<TextBox.Styles>
<Style Selector="TextBox /template/ TextPresenter">
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
</TextBox.Styles>
</TextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn> Link to full fixed file: HERE |
Beta Was this translation helpful? Give feedback.
I finally find solution:
The part of the code creates DataGridColumnHeader inside DataGridColumnHeader, so when I set AreSeparatorsVisible property to false, it hides only child DataGridColumnHeader separator.
Both Separators visible:
So solution was to set DataGrid.Styles: