Underline a Span

2 posts, 0 answers
  1. Stuart Cotts
    Stuart Cotts avatar
    16 posts
    Member since:
    Mar 2010

    Posted 12 Jul 2013 Link to this post

    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

     

     

  2. Deyan
    Admin
    Deyan avatar
    136 posts

    Posted 15 Jul 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top