RadzenTreeItem margins #236

Closed
opened 2026-01-29 17:33:57 +00:00 by claunia · 1 comment
Owner

Originally created by @PatrickKelley2112 on GitHub (Oct 28, 2021).

Describe the bug
The margins on the RadzenTreeItem appear to be wrong. If I change the left margin from 25px to 21px (the width of the caret), then everything seems to line up better.

This is the code changes I made to correct it.
With check boxes:
<RadzenCheckBox TValue="bool?" Value="@IsChecked()" Change="@CheckedChange" Style="@(ParentItem != null && !HasChildren ? "margin-left:21px;margin-right:5px;" : "margin-right:5px;")" />

Without check boxes:
<span class="rz-treenode-label" Style="@(Tree != null && !Tree.AllowCheckBoxes && ParentItem != null && !HasChildren ? "margin-left:21px;" : "")" >@Text</span>

To Reproduce
Steps to reproduce the behavior:

  1. Create a Tree that has elements with and without children
  2. Expand the nodes and take a look at the spacing

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Tested on Edge, Chrome, and FireFox
Originally created by @PatrickKelley2112 on GitHub (Oct 28, 2021). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** The margins on the RadzenTreeItem appear to be wrong. If I change the left margin from 25px to 21px (the width of the caret), then everything seems to line up better. This is the code changes I made to correct it. With check boxes: `<RadzenCheckBox TValue="bool?" Value="@IsChecked()" Change="@CheckedChange" Style="@(ParentItem != null && !HasChildren ? "margin-left:21px;margin-right:5px;" : "margin-right:5px;")" />` Without check boxes: `<span class="rz-treenode-label" Style="@(Tree != null && !Tree.AllowCheckBoxes && ParentItem != null && !HasChildren ? "margin-left:21px;" : "")" >@Text</span>` **To Reproduce** Steps to reproduce the behavior: 1. Create a Tree that has elements with and without children 2. Expand the nodes and take a look at the spacing **Desktop (please complete the following information):** - OS: Windows 10 - Browser: Tested on Edge, Chrome, and FireFox
Author
Owner

@akorchev commented on GitHub (Dec 2, 2021):

Hi @PatrickKelley2112,

Should be better in the latest releases.

@akorchev commented on GitHub (Dec 2, 2021): Hi @PatrickKelley2112, Should be better in the latest releases.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#236