Skip to content

Commit

Permalink
Merge pull request #968 from telerik/new-kb-remove-treeview-items-sep…
Browse files Browse the repository at this point in the history
…arator-lines-net-maui-61764521c1a1456fb0f548778bacb58f

Added new kb article remove-treeview-items-separator-lines-net-maui
  • Loading branch information
didiyordanova authored Oct 22, 2024
2 parents bd30c60 + a8fbcfe commit 81d4e33
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions knowledge-base/remove-treeview-items-separator-lines-net-maui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Removing Separator Lines in TreeView for .NET MAUI on Android and iOS
description: Learn how to remove the bottom border separator lines from TreeView items on both Android and iOS platforms in .NET MAUI applications.
type: how-to
page_title: How to Remove TreeView Items Separator Lines in .NET MAUI on Mobile Platforms
slug: remove-treeview-items-separator-lines-net-maui
tags: treeview, .net maui, android, ios, separator, border
res_type: kb
---

## Environment

| Version | Product | Author |
| --- | --- | ---- |
| 7.1.0 | Telerik UI for .NET MAUI TreeVIew | [Dobrinka Yordanova](https://www.telerik.com/blogs/author/dobrinka-yordanova) |

## Description

In a .NET MAUI application, each `TreeViewItem` on Android and iOS has a bottom border separator line as part of the `TreeViewItemView`. I need to remove this line for styling purposes.

This KB article also answers the following questions:
- How to style the TreeView items in .NET MAUI for mobile platforms?
- How to remove the border from TreeView items on Android and iOS?
- How to customize the appearance of TreeView items in .NET MAUI?

## Solution

To remove the bottom border separator line from TreeView items on both Android and iOS platforms, set the `BorderColor` to `Transparent` and the `BorderThickness` to `0`. Apply the following style definition in your XAML:

```xml
<Style TargetType="telerik:TreeViewItemView">
<Setter Property="BorderColor" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
</Style>
```

This style can be set either as an implicit style, which affects all TreeViewItemView elements within scope, or as an explicit style, which applies to the TreeView or to the `TreeViewItem` elements you assign it to.

## See Also

- [TreeView Overview]({%slug treeview-overview%})
- [Styling the .NET MAUI TreeView Item]({%slug treeview-item-style%})

0 comments on commit 81d4e33

Please sign in to comment.