How to know if content or text is changed

4 posts, 0 answers
  1. Valentijn
    Valentijn avatar
    21 posts
    Member since:
    Sep 2010

    Posted 23 Aug 2011 Link to this post

    Hi all

    I would like to know in code behind when the content in the richtextbox has changed. I know there is a 

    DocumentContentChanged event, but this event also fires when the user does nothing in the beginning when the radrichtextbox is created and after the document is loaded.
    Using the keydown or keyup is not really an option as those dont fire when a user pastes content by use of the mouse.

    Did somebody try to do this and know a solution for this?

    Best regards

    Valentijn

     

     

  2. Mihail
    Admin
    Mihail avatar
    241 posts

    Posted 24 Aug 2011 Link to this post

    Hi Valentijn,

    Currently DocumentContentChanged event is fired when the document is changed and when the content is changed. This behavior is by design.
    It will be helpful for us if you could give us any additional information about your scenario in case you need further assistance.

    Regards,
    Mihail
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. Valentijn
    Valentijn avatar
    21 posts
    Member since:
    Sep 2010

    Posted 14 Feb 2012 Link to this post

    This is the secnario:

    - A user opens the radrichtextbox, the save button is disabled
    - The previously created document gets loaded from the database and is loaded in the radrichtextbox
    - The user edits the document by entering some text or by pasting some text in the radrichtextbox

    I want to know when the user edits the document (so when the thrid step happens) to be able to enable the save button.

    As I said before I know there is a DocumentContentChanged event, but this event also fires when the user does nothing in the beginning when the radrichtextbox is created and after the document is loaded. Using the keydown or keyup is not really an option as those dont fire when a user pastes content by use of the mouse.

    Thank you for any help.

  4. Boby
    Admin
    Boby avatar
    685 posts

    Posted 17 Feb 2012 Link to this post

    Hi VAlentijn,
    We revised this behaviour and in later versions DocumentContentChanged is not raised on document changing (then only DocumentChanged is fired).

    All the best,
    Boby
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top