Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 575
  • Last Modified:

ASP.net Narrow font for TreeView


I have a TreeView where I use long sentences on the nodes - can anyone suggest a narrow fonr that is easy to read
Murray Brown
Murray Brown
4 Solutions
Alan WarrenCommented:
You can set the letter-spacing CSS attribute to a negative value and assign any font-family.
W3Schools.com - Try it yourself

<head runat="server">
    <style type="text/css">
      myNarrowStyle {font-family:Arial Narrow, Segoe UI, Arial,sans-serif; font-size:9px;}

Then populate your treeviewnodes CssClass="myNarrowStyle "

Lots of narrow fonts available:
Arial® Narrow Regular

Alan WarrenCommented:
Here's a start, create a CSS style with the same ID as your treeview ID

    <style type="text/css">
      #SampleTreeView {font-family:Arial Narrow, Segoe UI Arial, Arial; font-size:12px;}

Open in new window

TreeView narrow font style
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Alan WarrenCommented:
And here's a bit more:
<style type="text/css">
      #SampleTreeView {width:500px;font-family:Arial Narrow, Segoe UI Arial, Arial; font-size:32px;}
      .RootNode {background-color:#CCCCFF; }
      .ParentNode {color:Navy; background-color:#33CC33; }
      .Node {color:Orange;font-size:22px; }
      .LeafNode {color:Black;font-size:12px;letter-spacing:0px;}

Open in new window

Then in your treeview
        <LeafNodeStyle CssClass="LeafNode" />

        <NodeStyle CssClass="Node" />

        <ParentNodeStyle CssClass="ParentNode" />

        <RootNodeStyle CssClass="RootNode" />


Open in new window

Treeview style narrow font for LeafNodeStyle
Vikram Singh SainiSoftware Engineer cum AD DeveloperCommented:
You can use M 1m regular font in your case.

You can download same from: Free Font M+ Fonts
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now