Learn how to a build a cloud-first strategyRegister Now

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

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
0
Murray Brown
Asked:
Murray Brown
4 Solutions
 
informaniacCommented:
0
 
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">
    <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 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;}
       
    </style>

Open in new window

TreeView narrow font style
0
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;}
       
    </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 SainiSoftware 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

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