We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I perform Mathematical calculation in the RichTextEditor?


To perform mathematical calculations in the RichTextEditor by using the CustomTool.


Since there is no in-built plugin for performing mathematical calculations, you have to use the CustomTool option and customize the tool for the desired math calculations. Syncfusion has prepared a sample by using this custom tool that generates a Dialog box to perform simple mathematical operations and to insert the result to the RTE content. CustomTool dialog box has the NumericTextboxes to enter the data for calculation. Based on the selected operation, the resultant value is added to the RTE content.

Follow the steps in the following link to add a CustomTool in the RTE:


Refer to the code block for CustomTool and DialogBox creation.


  • Define the DialogBox content to be displayed on clicking the CustomTool button. Once the CustomTool button is created, define its Action to open the corresponding Dialog by using the show() API in the client side script.
  • Perform the desired mathematical operation in the Dialog and insert the resultant value to the RTE by using the executeCommand(commandname,value) method. Refer to the following code.


 The following screenshot is the output on performing calculations by using the CustomTool.


Figure 1: Model Dialog to perform calculations on clicking the CustomTool button

Figure 2: Result added to the RTE Content at the cursor position and dialog closed

Article ID: Published Date: Last Revised Date: Platform: Control:
4646 04/21/2015 07/20/2017 ASP.NET Web Forms RichTextEditor
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon