This is a migrated thread and some comments may be shown as answers.

Underline a Span

1 Answer 180 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Stuart Cotts
Top achievements
Rank 1
Stuart Cotts asked on 12 Jul 2013, 10:33 PM

TableCell cella = new TableCell();

cella.PreferredWidth = new TableWidthUnit(col2);

Paragraph p = new Paragraph();

Span sp = new Span("Flight Information");

sp.Underline = true; // Does Not work

sp.FontFamily = new System.Windows.Media.FontFamily("Calibri");

sp.FontSize = size * 1.33;

p.Inlines.Add(sp);

cella.Blocks.Add(p);

header.Cells.Add(cella);

table.Rows.Add(header);


I am creating a cell in a table, Underline property is read-only, do you have an example that I could use to underline the text of the span I am creating?

Thank-you
Stuart Cotts

 

 

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 15 Jul 2013, 12:39 PM
Hello Stuart,

Thank you for contacting us about this issue! 

In order to set the underline property, you need to specify the exact type of underlining you need. That is why in this case you will have to use the UnderlineDecoration property. Here is a sample code on setting the underline decoration to UnderlineTypes.DoubleLine. You may of course choose any of the other UnderlineTypes.

Span span = new Span("Some span text!");
span.UnderlineDecoration = UnderlineTypes.DoubleLine;

I hope this helps! If you have any other questions or concerns, please do not hesitate to contact us again!

Regards,
Deyan
the Telerik team
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Stuart Cotts
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or