This functionality comes out-of-the-box with the History
feature. You should set the Depth property of the RadDocuments' History:
.radRichTextBox.Document.History.Depth = 25;
By setting this property, you specify how many actions shall be recorded in the RadDocument's history. After the 25th operation the Undo button will be disabled automatically, because there won't be any other recorded actions.
Please, let us know if you have other questions.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.