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

How can I remove the border of the treelistview

9 Answers 76 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Bi Chao
Top achievements
Rank 1
Bi Chao asked on 03 Aug 2010, 02:35 AM
Hi,

I have just updated the new dll and got some trouble removing the border of the grid.

I tried to set the borderthickness=0 and borderbrush= white, but neither works, because I want to get all the border removed. Can anyone help?

9 Answers, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 04 Aug 2010, 09:06 AM
Hello Bi Chao,

Could you please be a bit more specific about which border are you referring to so I can be of assistance?

Sincerely yours,
Kalin Milanov
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
Bi Chao
Top achievements
Rank 1
answered on 05 Aug 2010, 09:51 AM

 

 

 

Below is my xaml code:
<
telerikGrid:RadTreeListView x:Name="grdResults" BorderThickness="0" Style="{StaticResource mytreeListFontStyle}" AutoGenerateColumns="False"

 

 

 

Visibility="Collapsed" EditTriggers="None" RowIndicatorVisibility="Collapsed"

 

 

 

AlternationCount="2" AlternateRowBackground="#E9E9E9FF" HorizontalAlignment="Left">

 

 

 

 

<telerikGrid:RadTreeListView.ChildTableDefinitions>

 

 

 

 

<telerikGrid:TreeListViewTableDefinition ItemsSource="{Binding Children}" />

 

 

 

 

</telerikGrid:RadTreeListView.ChildTableDefinitions>

 

 

 

 

<telerikGrid:RadTreeListView.Columns>

 

 

 

 

<telerikGrid:GridViewColumn Header="Item" MinWidth="260" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}">

 

 

 

 

<telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<StackPanel Orientation="Horizontal">

 

 

 

 

<CheckBox Visibility="{Binding CanDelete}" IsChecked="{Binding DeleteFlag, Mode=TwoWay}" Margin="-5,5,0,0" />

 

 

 

 

<TextBlock VerticalAlignment="Center" Text="{Binding Item, Mode=OneWay}" Height="25" Padding="0,5,0,0" />

 

 

 

 

</StackPanel>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

</telerikGrid:GridViewColumn>

 

 

 

 

<telerikGrid:GridViewColumn Width="75" Header="Size now" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}">

 

 

 

 

<telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock VerticalAlignment="Center" Text="{Binding SizeNow,Mode=OneWay}" />

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

</telerikGrid:GridViewColumn>

 

 

 

 

<telerikGrid:GridViewColumn Width="145" Header="Size of versioned data" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}">

 

 

 

 

<telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock VerticalAlignment="Center" Text="{Binding SizeOfVersionData, Mode=OneWay}" />

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

</telerikGrid:GridViewColumn>

 

 

 

 

<telerikGrid:GridViewColumn Header="Status and notes" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}">

 

 

 

 

<telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock VerticalAlignment="Center" Text="{Binding StatusNotes, Mode=OneWay}" TextWrapping="Wrap"/>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGrid:GridViewColumn.CellTemplate>

 

 

 

 

</telerikGrid:GridViewColumn>

 

 

 

 

</telerikGrid:RadTreeListView.Columns>

 

 

 

 

</telerikGrid:RadTreeListView>

 

0
Bi Chao
Top achievements
Rank 1
answered on 05 Aug 2010, 09:57 AM
Attached is a screenshot of the treelist view.  If you look at the header, you will see the inner border.

Thanks and regards,

Bill Chao | Analyst Programmer | Tel +61-2-9386-0202 | Mob +61-433-558-976 | Fax +61-2-9386-0035 | www.solvexia.com

Suite 1506, Westfield Tower 2, 101 Grafton Street, Bondi Junction, NSW 2022, Australia

0
Accepted
Kalin Milanov
Telerik team
answered on 09 Aug 2010, 11:49 AM
Hi Bi Chao,

To do this you will need to edit the template of the header cell and remove the border manually. Following is the XAML you need look for and the highlight marks the color you need to change / remove.

<Border x:Name="GridViewHeaderCell" Grid.ColumnSpan="2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">   
    <Border BorderBrush="{StaticResource GridView_HeaderInnerBorder}" Background="{TemplateBinding Background}" BorderThickness="1" />
</Border>  

I hope this helps solve your issue.

All the best,
Kalin Milanov
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
Bi Chao
Top achievements
Rank 1
answered on 16 Aug 2010, 01:45 AM
Thanks Kalin.  Much appreciated. This solved our problem.

However, it is not very convinient.  I suppose is a user set the border, it should set the inner border as well.

Another this I found is the new treelistview is a bit slow than the old one after you rewrote is based on gridview.

For 30 records,if the records are not loaded, the new one takes 7.8s to expand, while the old one takes 2.8s.
if arleady loaded, the new one takes 7.2s to expand, while the old one takes 0.1s

Is there a way to improve this?
0
Milan
Telerik team
answered on 17 Aug 2010, 02:38 PM
Hello Bi Chao,

There are several possible ways to achieve better performance. First you could make sure that RadTreeListView is not placed in a container that measures it with infinite height/width like StackPanel, ScrollViewer, etc.

I noticed that you use many columns with custom CellTemplate which can be replaced with GridViewDataColumn which will automatically place a TextBlock and usually provides better performance. 

For example:

<telerikGrid:GridViewColumn Width="75" Header="Size now" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}"
    <telerikGrid:GridViewColumn.CellTemplate
        <DataTemplate>
            <TextBlock VerticalAlignment="Center" Text="{Binding SizeNow,Mode=OneWay}" /> 
        </DataTemplate>
    </telerikGrid:GridViewColumn.CellTemplate
</telerikGrid:GridViewColumn>
  
<!-- same as -->
<telerikGrid:GridViewDataColumn DataMemberBinding="{Binding SizeNow,Mode=OneWay}"/>

If performances does not improve we would really appreciate it if we can take a look at the application itself. 


Best wishes,
Milan
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
Bi Chao
Top achievements
Rank 1
answered on 20 Aug 2010, 07:06 AM
Hi,

Thanks for your suggestions.

That code was used in the old treelistview control and worked good. Now we are using 2010.2.730.1040's version... Will try it and let you know.
0
Bi Chao
Top achievements
Rank 1
answered on 20 Aug 2010, 08:44 AM

 

Hi, I change the xaml as you suggested. The performance has been improved, but it still takes 1-2 secends even its loaded.

I think the reason is I kept the first column as the original template, and it contains some checkboxes. Any solutions?  And for the inner border, are you guys gonna address that issue in the future build. My boss really dont feel happy about it. He want our code to be as easy as possible so that it is easy to maintain.

The xaml code of the first column:
<telerikGrid:GridViewColumn Header="Item" MinWidth="260" HeaderCellStyle="{StaticResource myHeaderStyle}" CellStyle="{StaticResource myCellStyle}">
                  <telerikGrid:GridViewColumn.CellTemplate>
                      <DataTemplate>
                          <StackPanel Orientation="Horizontal">
                              <CheckBox Visibility="{Binding CanDelete}" IsChecked="{Binding DeleteFlag, Mode=TwoWay}"  Margin="-5,5,0,0"  />
                              <TextBlock VerticalAlignment="Center" Text="{Binding Item, Mode=OneWay}" Height="25" Padding="0,5,0,0" />
                          </StackPanel>
                      </DataTemplate>
                  </telerikGrid:GridViewColumn.CellTemplate>
              </telerikGrid:GridViewColumn>

 

0
Milan
Telerik team
answered on 20 Aug 2010, 09:18 AM
Hi Bi Chao,

I am glad that performance has improved. Probably it can be improved even further but we will have to take a look at the application itself. 

In regard to the styling issues, we will think about possible ways to improve the styling experience but most probably we will not be able to introduce any changes in the near future. 


All the best,
Milan
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
Tags
TreeListView
Asked by
Bi Chao
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Bi Chao
Top achievements
Rank 1
Milan
Telerik team
Share this question
or