This is a migrated thread and some comments may be shown as answers.

Can't remove border around the headers

2 Answers 94 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 28 Oct 2010, 03:52 PM
Hi, I've tried to remove the border around the headers with the approach outlined in another thread but it doesn't work. How can I get rid of the inner border in the header cells of the treelistview? It shouldn't be this hard to get rid of borders. I am using the Q3 release.
<telerik:RadTreeListView x:Name="publicationsTreeView" Style="{StaticResource TreeView}" RowStyle="{StaticResource TreeListViewRowStyle}" 
                    AlternateRowStyle="{StaticResource TreeListViewAlternateRowStyle}" HeaderRowStyle="{StaticResource TreeListHeaderRowStyle}">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Publications}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Title" Width="250" HeaderCellStyle="{StaticResource TreeViewHeaderCell}" />
                <telerik:GridViewDataColumn Header="Last published" Width="100" DataMemberBinding="{Binding LastPublished}" HeaderCellStyle="{StaticResource TreeViewHeaderCell}" >
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding LastPublished, Converter={StaticResource dateConverter}}" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding FrequencyName}" Width="58" Header="" HeaderCellStyle="{StaticResource TreeViewHeaderCell}"/>
                <telerik:GridViewDataColumn Header="Read" Width="40" DataMemberBinding="{Binding ReadInformation.ReadImageUrl}" HeaderCellStyle="{StaticResource TreeViewHeaderCell}">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding ReadInformation.ReadImageUrl}" Width="20" Height="20">
                                <ToolTipService.ToolTip>
                                    <StackPanel Visibility="{Binding ReadInformation.Status, Converter={StaticResource tooltipVisibilityConverter}}" Width="300" >
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding ReadInformation.Status, Converter={StaticResource readConverter}}" FontWeight="Bold" />
                                            <TextBlock Text=" - " />
                                            <TextBlock Text="{Binding Name}" />
                                        </StackPanel>
                                        <Line Style="{StaticResource TitleSeparator}" />
                                        <TextBlock Text="{Binding ReadInformation.Status, Converter={StaticResource readTextConverter}}" />
                                        <StackPanel Visibility="{Binding ReadInformation.Status, Converter={StaticResource partialReadVisibilityConverter}}">
                                            <TextBlock Text=" " />
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="Date: " />
                                                <TextBlock Text="{Binding ReadInformation.Date, StringFormat='dd MMM yyyy'}" />
                                            </StackPanel>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="Time: " />
                                                <TextBlock Text="{Binding ReadInformation.Date, StringFormat='hh:mmtt'}" />
                                            </StackPanel>
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="Method: " />
                                                <TextBlock Text="{Binding ReadInformation.Method}" />
                                            </StackPanel>
                                        </StackPanel>
                                    </StackPanel>
                                </ToolTipService.ToolTip
                            </Image>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>


<Style x:Key="TreeView" TargetType="telerik:RadTreeListView">
    <Setter Property="AlternateRowBackground" Value="#FFFFFFFF" />
    <Setter Property="AutoGenerateColumns" Value="False" />
    <Setter Property="RowIndicatorVisibility" Value="Collapsed" />
    <Setter Property="IsFilteringAllowed" Value="False" />
    <Setter Property="GridLinesVisibility" Value="None" />
    <Setter Property="EditTriggers" Value="None" />
    <Setter Property="CanUserResizeColumns" Value="False" />
    <Setter Property="CanUserSelect" Value="False" />
    <Setter Property="IsReadOnly" Value="True" />
    <Setter Property="IsSynchronizedWithCurrentItem" Value="False" />
    <Setter Property="CanUserFreezeColumns" Value="False" />
    <Setter Property="AlternationCount" Value="2" />
    <Setter Property="BorderBrush" Value="White" />
    <Setter Property="BorderThickness" Value="0" />
    <Setter Property="CanUserReorderColumns" Value="False"/>
    <Setter Property="CanUserSortColumns" Value="False"/>
    <Setter Property="ShowGroupPanel" Value="False"/>
    <Setter Property="EnableColumnVirtualization" Value="False"/>
    <Setter Property="EnableRowVirtualization" Value="False"/>
    <Setter Property="DragElementAction" Value="None"/>
    <Setter Property="IsDragPreviewEnabled" Value="False"/>
    <Setter Property="IsDragTooltipEnabled" Value="False"/>
    <Setter Property="IsDropPreviewLineEnabled" Value="False"/>
    <Setter Property="ReorderColumnsMode" Value="None"/>
    <Setter Property="CanUserDeleteRows" Value="False"/>
    <Setter Property="CanUserInsertRows" Value="False"/>
</Style>
<Style x:Key="TreeListHeaderRowStyle" TargetType="telerik:GridViewHeaderRow">
    <Setter Property="Background" Value="White"/>
    <Setter Property="Foreground" Value="Black"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="Padding" Value="0"/>
</Style>
<Style x:Key="TreeViewHeaderCell" TargetType="telerik:GridViewHeaderCell">
    <Setter Property="Background" Value="White"/>
    <Setter Property="Foreground" Value="Black"/>
    <Setter Property="BorderThickness" Value="0"/>
    <Setter Property="VerticalContentAlignment" Value="Stretch"/>
    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
    <Setter Property="Padding" Value="5"/>
</Style>
<Style x:Key="TreeListViewRowStyle" TargetType="Telerik_Windows_Controls_TreeListView:TreeListViewRow">
    <Setter Property="Background" Value="#FFEEEEEE"/>
</Style>
<Style x:Key="TreeListViewAlternateRowStyle" TargetType="Telerik_Windows_Controls_TreeListView:TreeListViewRow">
    <Setter Property="Background" Value="#FFFFFFFF"/>
</Style>

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 29 Oct 2010, 04:06 PM
Hello James,


If you want to remove this border you should edit the template of GridViewHeaderCell. Actually this is the inner border of GridViewCell and you cannot remove it with a simple style. Using your code snippet I have prepared an example for you that resets the BorderThickness property of this border.

Please see the attached and let me know if you need any further assistance.

Kind regards,
Vanya Pavlova
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
James
Top achievements
Rank 1
answered on 29 Oct 2010, 04:38 PM
Thanks that worked.
Tags
TreeListView
Asked by
James
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
James
Top achievements
Rank 1
Share this question
or