Can't remove border around the headers

3 posts, 0 answers
  1. James
    James avatar
    6 posts
    Member since:
    Oct 2010

    Posted 28 Oct 2010 Link to this post

    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. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 29 Oct 2010 Link to this post

    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
  3. DevCraft banner
  4. James
    James avatar
    6 posts
    Member since:
    Oct 2010

    Posted 29 Oct 2010 Link to this post

    Thanks that worked.
Back to Top