Removing child views from the View

Removing child views from the View

Posted on February 24, 2009 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

[This post is part of the developer's manual preview published on this blog. You can find temporary TOC here.]

 
[This article requires Sitefinity 3.6 hotfix to be installed

 

In the article preceding this one, we have seen how one can add a brand new child view to a View. In this article we will do exactly the opposite. We are going to remove an existing child view from a View.
The principle for removing the child view is basically the same as for adding it, though instead of the add method, this time we will use remove method.

 

Scenario: cripple the Events module

 

Our ever demanding boss has decided that “Geomapping settings” has no business in the Events module and she wants it gone. Once we are done there should be no user interface command for accessing Geomapping settings, nor should there be any other way to access it. To refresh your memory and get a clearer picture of what are we about to do, take a look at the following image.

 


 

Implementation


As it was the case with adding a new child view, yet again we need an ability to access the child views collection of a host view in order to remove the view. Since we are working with the Events module this time, the root view which is the host to GeomappingSettingsView is EventsControlPanel.

 

To remove the GeomappingSettingsView, all we need to do is set the following declaration in our Controls Config file.

<?xml version="1.0" encoding="utf-8"?> 
<controlsConfig> 
  <viewMap> 
    <!--Root view of the Events module.--> 
    <viewSettings hostType="Telerik.Events.WebControls.Admin.EventsControlPanel"
      <views> 
        <remove name="GeomappingSettingsView`1" /> 
      </views> 
    </viewSettings> 
  </viewMap> 
</controlsConfig> 
 

As you can see, our logic is exactly the same as it was when we were adding a new view, but this time we are removing the View. 

 

progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments

Comments are disabled in preview mode.
Topics

Sitefinity Training and Certification Now Available.

Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.

Learn More
Latest Stories
in Your Inbox

Subscribe to get all the news, info and tutorials you need to build better business apps and sites

Loading animation