Removing Topic Links from Topic Pages
In This Topic
You can remove topic links from topic pages using the floating toolbar, the collection editor, and code. In this topic, you will learn how to remove topic links using each of the aforementioned methods. This topic assumes that you have a C1TopicBar control containing at least one topic link (see Adding Topic Links to Topic Pages) on your page.
Using the Floating Toolbar
Complete the following steps:
- Using your cursor, hover over the topic link you wish to remove until its floating toolbar appears. The topic link's toolbar appears similar to the following:
- Click the Delete topic link button.
The topic link is removed from the topic page.
Using the Collection Editor
Complete the following steps:
- Click C1TopicBar's smart tag () to open the C1TopicBar Tasks menu.
- On the C1TopicBar Tasks menu, click Edit Pages.
The C1TopicPage Collection Editor opens.
- In the Members pane, select a page.
- In the Properties grid, locate the Links property and click the ellipsis button . The C1TopicLink Collection Editor opens.
- In the Members pane, select the link you wish to remove.
- Click Remove to remove the link.
- Click OK to close the C1TopicPage Collection Editor.
- Click OK to close the C1TopicLink Collection Editor. The topic link is removed from the topic page.
Using Code
Complete the following steps:
- Click C1TopicBar's smart tag () to open the C1TopicBar Tasks menu.
- On the C1TopicBar Tasks menu, click Edit Pages.
The C1TopicPage Collection Editor opens.
- In the Members pane, select the page that holds the link you wish to remove.
- In the Properties grid, set the page's Tag property to “PageWithLink”. This will allow you to find the page in the code by using the FindPageByTag method.
- In the Properties grid, locate the Links property and click the ellipsis button . The C1TopicLink Collection Editor opens.
- Select the link you wish to remove in code and, in the Properties grid, set the link's Tag property to “LinkToRemove”. This will give the link a unique indicator, which will allow you to find it in code using the FindLinkByTag method.
- Click OK to close the C1TopicPage Collection Editor.
- Click OK to close the C1TopicLink Collection Editor.
- Double-click the empty portion of the form to open Code view. Notice that a Form_Load event handler has been added to Code view.
- Add the following code to the Form_Load event. This code will find the page and link, assign them to variables, and then will remove the link from the page.
To write code in Visual Basic
Visual Basic |
Copy Code
|
'Find page and assign to variable
Dim c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithLink")
'Find link and assign to variable
Dim c1TopicLink1 = c1TopicPage1.FindLinkByTag("LinkToRemove")
'Remove link from page
c1TopicPage1.Links.Remove(c1TopicLink1)
|
To write code in C#
C# |
Copy Code
|
//Find page and assign to variable
var c1TopicPage1 = c1TopicBar1.FindPageByTag("PageWithLink");
//Find link and assign to variable
var c1TopicLink1 = c1TopicPage1.FindLinkByTag("LinkToRemove");
//Remove link from page
c1TopicPage1.Links.Remove(c1TopicLink1);
|
- Press F5 to build the project.
See Also