Links Ignored in RadRichTextPageView

4 posts, 0 answers
  1. Kelly
    Kelly avatar
    73 posts
    Member since:
    Apr 2011

    Posted 05 Jul 2012 Link to this post

    Hello:

    I am using a RadRichTextPageView inside a RadBook with code based on your demo here. I use an RtfFormatProvider to load an RTF file compiled in as a resource. This RTF file contains a Table of Contents. The TOC entries show up as hyperlinks in the RadRichTextPageView , and if I hover over them with the mouse, the cursor eventually changes to a Hand and a message saying "Ctrl-Click to follow Link" appears. However, Ctrl-click does nothing.

    I have other embedded links (urls to external websites) in the same document that DO work, until I install the application OOB.

    I need all of the links to work all of the time - OOB or not. Any suggestions?

    Thank you,

    KO
  2. Boby
    Admin
    Boby avatar
    595 posts

    Posted 10 Jul 2012 Link to this post

    Hi Kelly,
    The issue with hyperlinks not working in OOB mode is known and is in our to-do list, but it's not scheduled from implementation yet. You can, however, easily work around it using the public API and some of the methods in this stackoverflow article, for example:
    public partial class MainPage : UserControl
    {
        public class MyHyperlinkButton : HyperlinkButton
        {
            public void ClickMe()
            {
                base.OnClick();
            }
        
     
        public MainPage()
        {
            InitializeComponent();
     
            this.radRichTextBox.HyperlinkClicked += (sender, e) =>
            {
                if (App.Current.IsRunningOutOfBrowser)
                {
                    MyHyperlinkButton button = new MyHyperlinkButton();
                    button.NavigateUri = new Uri(e.URL, UriKind.Absolute);
                    button.TargetName = "_blank";
                    button.ClickMe();
                }
            };
        }
    }


    Kind regards,
    Boby
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. Kelly
    Kelly avatar
    73 posts
    Member since:
    Apr 2011

    Posted 10 Jul 2012 Link to this post

    Boby,

    I will try using the HyperlinkClicked event to change the PageIndex of the RadRichBoxPageView. Is that what you are thinkiing?

    But can you please tell me how to get a reference to the RadRichTextBox so I can trap the HyperlinkClicked event? I'm using a RadRichTextPageView in a DataTemplate that is applied to the RadBook's LeftPageTemplate and RightPageTemplate.  There must be a RadRichTextBox buried in there somewhere...

    Thank you,

    Kelly
  5. Kelly
    Kelly avatar
    73 posts
    Member since:
    Apr 2011

    Posted 10 Jul 2012 Link to this post

    Thank you, but please disregard the above questions.  We decided not to use the RadRichTextPageView.

    Kelly
Back to Top