MS Word provides a quick insert table drop-down to insert tables into the document. This sample shows how to replace the insert table button with such a table insert drop-down.

MVC: Replace the ribbon table menu with a quick insert table drop-down

The replacement and the new drop down button is done using Javascript and can be found in the GitHub repository. In order to insert the specific table, a controller method is called using Javascript:

Loading...

The controller method creates a new ServerTextControl instance to insert the specified table. The document is returned to the client and inserted at the current input position using the Javascript method loadSelection.

Loading...

Download the sample from GitHub and test it on your own.

GitHub

Download and Fork This Sample on GitHub

We proudly host our sample code on github.com/TextControl.

Please fork and contribute.

Requirements for This Sample

  • Visual Studio 2012 or better
  • TX Text Control .NET Server for ASP.NET (trial sufficient)