The Custom Links dropdown of Telerik RadEditor is a very convenient tool for inserting predefined hyperlinks. Those will usually be one of the following two types of links:
-
Internal site links (i.e. links to other pages of the web-site). You can preload the Custom Links treeview with the complete structure of your site so that the end-users would just need to select a page from the dropdown (e.g."About-us -> History").
-
Frequently used external links (e.g. Google).
Custom links are kept in the Links collection. You can add a new custom link using the Add method for this collection.

In the following example, we will construct a simple 3-level Custom Links treeview:
Please, note that the Add method returns XmlNode. So the code to build the tree-view above will be:
| ASPX |
Copy Code |
|
<rad:RadEditor id="RadEditor1" Runat="server"></rad:RadEditor> |
| C# |
Copy Code |
|
|
| VB.NET |
Copy Code |
|
RadEditor1.Links.Clear() RadEditor1.Links.Add("Telerik", "http://www.telerik.com")
RadEditor1.Links("Telerik").Add("Products", "http://www.telerik.com/products") RadEditor1.Links("Telerik")("Products").Add("Telerik RadControls for ASP.NET suite", "http://www.telerik.com/radcontrols") RadEditor1.Links("Telerik")("Products").Add("Telerik RadNavigation suite", "http://www.telerik.com/radnavigation") RadEditor1.Links("Telerik")("Products").Add("Telerik RadEditor", "http://www.telerik.com/radeditor") RadEditor1.Links("Telerik")("Products")("Telerik RadEditor").Add("QSF", "http://www.telerik.com/Telerik RadEditor/?Tab=Examples&Example=ServersideAPI") RadEditor1.Links("Telerik").Add("Purchase", "http://www.telerik.com/purchase") RadEditor1.Links("Telerik").Add("Support", "http://www.telerik.com/support") RadEditor1.Links("Telerik").Add("Client.Net", "http://www.telerik.com/clientnet") |
You can also populate the Custom Links treeview using the ToolsFile.xml file, as shown in the example below:
| ToolsFile.xml |
Copy Code |
|
|
 |
Please, bear in mind that the Telerik RadEditor will persist its state (including the Custom Links set) between postbacks. In order to create a new set of Custom Links (e.g. for different users), you will need to clear it first. This can be done using Remove method of the Links collection. |
See Also