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

TextInput Event

3 Answers 160 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 09 May 2012, 12:07 AM
Hi,

Is there any reason why the richtextbox TextInput event doesn't fire? Does it have something to do with it hosting a document?

DocumentContentChanged etc events fire. I am just wondering why TextInput doesnt?... mainly for reference purposes.

Thanks,

Rob

3 Answers, 1 is accepted

Sort by
0
Boby
Telerik team
answered on 11 May 2012, 11:34 AM
Hello Robert,
For now such functionality is not implemented. Could you share why would you use such event, so we can better evaluate its necessity?
DocumentContentChanged is asynchronous event which is raised on every document change, but not often than predefined time interval.


All the best,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Robert
Top achievements
Rank 1
answered on 11 May 2012, 01:57 PM
Hi Boby,

Thanks for getting back to me.

I'm creating my own IntelliSense application where the user types in text and the application then tries to find a match from a database item. Currently I use the DocumentChanged event to catch any "Typed Text" which then in turn evaluates the text against my database items and adds custom annotation tags should a match me found.

The DocumentChanged event will fire even if images etc are inserted. I just thought it might be a cleaner process if the event fires only when text is input. i.e. I don't care about evaluating/catching/ignoring images etc.

All the best,

Rob
0
Boby
Telerik team
answered on 16 May 2012, 09:16 AM
Hi Robert,
If subscribing to RadRichTextBox.DocumentContentChanged doesn't fit your scenario, you can try to filter document edits by command type, for example:
this.radRichTextBox.CommandExecuted += (sender, e) =>
    {
        if (e.Command is InsertTextCommand ||
            e.Command is PasteCommand ||
            e.Command is MoveSelectionCommand)
        {
            MessageBox.Show("text edited");
        }
    };


All the best,
Boby
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Robert
Top achievements
Rank 1
Answers by
Boby
Telerik team
Robert
Top achievements
Rank 1
Share this question
or