TreeListView - remove lines from column with Tree.

2 posts, 0 answers
  1. Jakub
    Jakub avatar
    14 posts
    Member since:
    Sep 2015

    Posted 26 Nov 2015 Link to this post



    i'm looking for help with removing lines/border from column where i have hierarchical tree.


    Property GridLinesVisibility is not solution because removes/adds lines in whole grid, but i want remove only in my first column.


    I created styles based on GridviewCellStyle and applied them to cells, but without any results. RadTreeListView shows or not lanes only according to GridLinesVisibility, my styles changes nothing.


            <Style x:Key="CellWithoutLanes" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
                <Setter Property="BorderThickness" Value="0" />
            <Style x:Key="CellWithLanes" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
                <Setter Property="BorderBrush" Value="Black"/>
                <Setter Property="BorderThickness" Value="5,5,5,5" />
            <telerik:RadTreeListView ItemsSource="{Binding Processes}"
                    <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
                                                CellStyle="{StaticResource ResourceKey=CellWithoutLanes}">
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    <TextBlock Grid.Column="0" Text="{Binding Id}"/>
                                    <TextBlock Grid.Column="1" Text="{Binding Name}"/>
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Id}"
                                                CellStyle="{StaticResource ResourceKey=CellWithLanes}" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Expression}"
                                                CellStyle="{StaticResource ResourceKey=CellWithLanes}" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding UserPriority}"
                                                CellStyle="{StaticResource ResourceKey=CellWithLanes}" />


    Best regards,


  2. Stefan Nenchev
    Stefan Nenchev avatar
    238 posts

    Posted 27 Nov 2015 Link to this post

    Hello Jakub,

    In order to remove the lines for the first column, you have to edit the Control Template of the GridViewCell in the Style that targets that specific column. You can refer to the following documentation page - Editing Control Templates. The ControlTemplate of the GridViewCell contains a border element and you need to change its BorderThickness property from there. As you can notice once you check the Control Template of the cell, there are border elements for the different states(Normal, Selected, Current, etc.) so you can modify them with accordance to your preference. The following article should also be helpful for you - Styling Cells.

    Stefan Nenchev
    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 Feedback Portal and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top