RadRichTextBox and DataProvider Setup

2 posts, 0 answers
  1. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2013 Link to this post

    Good Morning Telerik Team,

    I'm having some issues getting rRichTextBox and DataProvider to work togther.  I need to set them up in the code behind and I think I'm doing it correctly, but some events aren't firing.  Below is code snippet where I'm passing in a rtb and assigning it to an HtmlDataProvider and subscribing to the SetupDocument event, but the event isn't firing.  I've verified that this method is called before the RadDocument is assigned to the rtb.

    ??? 

    Thanks
    public void Initialize(RadRichTextBox radRichTextBox)
    {
        _radRichTextBox = radRichTextBox;
        _onRadRichTextBoxShowingEventHandler = OnRadRichTextBoxShowing;
     
        var contextMenu = (ContextMenu)radRichTextBox.ContextMenu;
        contextMenu.Showing += _onRadRichTextBoxShowingEventHandler;
     
        _radRichTextBox.DocumentInheritsDefaultStyleSettings = true;
        HtmlDataProvider.RichTextBox = _radRichTextBox;
        HtmlDataProvider.SetupDocument += HtmlDataProviderOnSetupDocument;           
    }
  2. WILLIAM
    WILLIAM avatar
    134 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2013 Link to this post

    I figured it out!!  You have to subscribe to the event before setting the RichTextBox property.
  3. DevCraft banner
Back to Top