-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #968 from telerik/new-kb-remove-treeview-items-sep…
…arator-lines-net-maui-61764521c1a1456fb0f548778bacb58f Added new kb article remove-treeview-items-separator-lines-net-maui
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
knowledge-base/remove-treeview-items-separator-lines-net-maui.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%}) |