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

How to know if content or text is changed

3 Answers 289 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Valentijn
Top achievements
Rank 1
Valentijn asked on 23 Aug 2011, 08:34 AM
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

 

 

3 Answers, 1 is accepted

Sort by
0
Mihail
Telerik team
answered on 24 Aug 2011, 12:47 PM
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 >>

0
Valentijn
Top achievements
Rank 1
answered on 14 Feb 2012, 02:47 PM
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.

0
Boby
Telerik team
answered on 17 Feb 2012, 09:40 AM
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 >>
Tags
RichTextBox
Asked by
Valentijn
Top achievements
Rank 1
Answers by
Mihail
Telerik team
Valentijn
Top achievements
Rank 1
Boby
Telerik team
Share this question
or