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

RadRichTextBox and DataProvider Setup

1 Answer 48 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
WILLIAM
Top achievements
Rank 1
WILLIAM asked on 14 Jun 2013, 01:26 PM
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;           
}

1 Answer, 1 is accepted

Sort by
0
WILLIAM
Top achievements
Rank 1
answered on 14 Jun 2013, 02:50 PM
I figured it out!!  You have to subscribe to the event before setting the RichTextBox property.
Tags
RichTextBox
Asked by
WILLIAM
Top achievements
Rank 1
Answers by
WILLIAM
Top achievements
Rank 1
Share this question
or