TxtDataProvider.StringChanged Event

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

    Posted 04 May 2016 Link to this post

    The documentation for the TxtDataProvider shows a StringChanged event that is inheritied from DataProviderBase.  However, I cannot find this event to subscribe to it.  I need to know when the text has changed.  I have subscribed to the DocumnetOnChangedEvent, but this only fires if I'm typing into the control.  If I paste into the control, this event doesn't fire.  I would expect that it should, but it doesn't.  So I wanted to try the StringChanged event on the TxtDataProvider.

    Where do I find this event (or some other event) that will notify me that the user has pasted content in the RichTextBox control.

    I'm referencing Telerik.Windows.Documents in the project and the version is 2016.1.217.1050, which matches the version in the documentation except for .215 vs .217

    Thanks for your help!!

  2. Tanya
    Tanya avatar
    577 posts

    Posted 09 May 2016 Link to this post

    Hello William,

    The StringChanged event is a protected method of the DataProviderBase class and could be accessed only by derived classes.

    In order to achieve the desired goal, you could use the DocumentContentChanged event of RadRichTextBox - it will notify you when the users enter, paste or modify the styles of the document content.

    Another option, which could help you track only the paste is to subscribe to the CommandExecuting event of the control and check whether the Command is a PasteCommand:
    void radRichTextBox_CommandExecuting(object sender, Telerik.Windows.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
        if (e.Command is Telerik.Windows.Documents.RichTextBoxCommands.PasteCommand)

    Hope this helps.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top