Useful Events

There are many events available for this HTML Editor. Here is a list of most important events that you may be interested about.

HtmlChanged : This event is fired as soon as the HTML of the editor is changed. It is similar to the TextChanged event of a TextBox control.

Pasting : This event is fired just before some content from clipboard is being pasted to the Editor. The event argument object contains some useful members. Here is the complete picture of the Event Args.

pasting_eventarg

The PastingRawHtml property is a read only property which gives you the RAW HTML from the clipboard. The PastingHtml property can be read and written, it returns the clean HTML that is being pasted, you can change the HTML and set some altered HTML according to your logic and if you do so, your altered HTML will be pasted to the editor. The Cancel property will completely cancel the pasting.

SelectionChanged : This event is very useful for programming context sensible logic. For example, if you want to be notified when the cursor is changed from one element to another element, then this is the event you are looking for. For example, this is the event where the Bold button is activated / deactivated based on the context (if the active element is bold or not)

EditorModeChanged : This event is fired whenever the user changes the Editor mode. (For example, WYSIWYG mode to Html Source Edit mode or Read Only Preview mode...etc..)

SpellCheckCompleted : This event is fired when the spell checking is completed. It is explained in the SpellChecker chapter.

KeyDown : This event is fired when a Key is pressed. The event argument contains many useful members.

key_down_event

StatusChanged : This event is useful specially for the FTP image upload feature. Its usage is explained in the Local Image Upload by FTP section.

ErrorOccured : In many cases, instead of throwing Exceptions, we caused this event fire so that, the Exceptions are hidden from your end users but you as a developer can capture the Exception silently and investigate the problem. It's event argument object contains the Exception object.

So, these are the most useful events that we wanted you to look at. There are other useful events too like Click, GotFocus etc, and more, you can check the Visual Studio Property browser for more info.

For details about the API, please check the class library reference

Last updated on 30 May 2015, Saturday, 3:18:23 AM
If you have any questions or concerns about this tutorial, Please feel free to share your comment.