[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Wpf Listview text formatting

Posted on 2012-03-12
1
Medium Priority
?
692 Views
Last Modified: 2012-03-23
Hi!

Is it possible to format text in wpf listview  i.e i have one cell that contains name and title.

i would like to have the name in BOLD and little bigger font size than the Title in the same cell.  

like this with a linefeed

Firstname SecName   --BOLD and 2 sizes bigger
CEO of xxxxxxx   smaller and perhaps Italics
0
Comment
Question by:jamppi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 37710910
I would say that you could use a TextBlock in the ListBox item template, with different Run elements that have different styles applied.

XAML example:

<TextBlock.Inlines>
            <Run FontWeight="Bold" FontSize="14" Text="This is WPF TextBlock Example. " />
            <Run FontStyle="Italic" Foreground="Red" Text="This is red text. " />
            <Run FontStyle="Italic" FontSize="18" Text="Here is some linear gradient text. ">
                <Run.Foreground>
                    <LinearGradientBrush>
                        <GradientStop Color="Green" Offset="0.0" />
                        <GradientStop Color="Purple" Offset="0.25" />
                        <GradientStop Color="Orange" Offset="0.5" />
                        <GradientStop Color="Blue" Offset="0.75" />
                    </LinearGradientBrush>
                </Run.Foreground>
            </Run>
            <Run FontStyle="Italic" Foreground="Green" Text="How about adding some green? " />
        </TextBlock.Inlines>

Open in new window

0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question