Iva's approach works in theory, but it has a major flaws in reality...
a) If you are checking the length against the TxtDataFormaters trimmed text result and then moving the cursor to a position in the formatted content, that will not work. (this example only works if plain text is being inputted)
b) Chopping or deleting formatted text could be very dangerous. If the content is html or xaml and you simply delete characters after a position, then what happens to the formatted result? Couldn't you be potentially chopping off close tags that cause malformed markup? The content we are editing in the richtextbox is targeted for use outside of Silverlight as well (Word, PDF, and HTML).
Has anyone implemented a reliable solution to limiting the "text" length in a RadRichTextBox? We have requirements to do this and need to come up with something.
If not, I am thinking you have to bite the bullet and include formatting in the check. However the first 3000 characters could all be style setups depending on how much styling the user has implemented.
I am using a later version of Telerik Controls, but came up with a possible solution. Hmm. I thought, what about using Undo. Tried the following and it seems to work, even on paste (so the DocumentContentChanged event is catching),
sender, EventArgs e)
RadRichTextBox rtBox = sender
(noteText.Length > maxText)
Only thing left would be removing the Redo option to make a mess again from the Document.History.