ASP.net Narrow font for TreeView

Hi

I have a TreeView where I use long sentences on the nodes - can anyone suggest a narrow fonr that is easy to read
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
Obadiah ChristopherConnect With a Mentor Commented:
0
 
Alan WarrenConnect With a Mentor Applications DeveloperCommented:
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">
    <title></title>
    <style type="text/css">
      myNarrowStyle {font-family:Arial Narrow, Segoe UI, Arial,sans-serif; font-size:9px;}
    </style>
</head>


Then populate your treeviewnodes CssClass="myNarrowStyle "

Lots of narrow fonts available:
Arial® Narrow Regular


Alan
0
 
Alan WarrenConnect With a Mentor Applications DeveloperCommented:
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;}
       
    </style>

Open in new window

TreeView narrow font style
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Alan WarrenApplications DeveloperCommented:
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;}
       
    </style>

Open in new window



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

        <NodeStyle CssClass="Node" />

        <ParentNodeStyle CssClass="ParentNode" />

        <RootNodeStyle CssClass="RootNode" />

      </asp:TreeView>

Open in new window

Treeview style narrow font for LeafNodeStyle
0
 
Vikram Singh SainiConnect With a Mentor Software Engineer cum AD DeveloperCommented:
You can use M 1m regular font in your case.

You can download same from: Free Font M+ Fonts
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.