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.
NewsView is to override its CreateChildControls() method. The default ContentView class implementation resolves the ViewType and loads the View inside an override of CreateChildControls. As we've mentioned in the above paragraph, the ViewType and Viewname are stored as key-value pairs inside the ControlDefinition. So in order to tell our widget that it needs to load the custom ViewType instead of the default one we just need to say:
public
class
NewsViewCustom:NewsView
{
protected
override
void
CreateChildControls()
{
this
.ControlDefinition.Views.Where(v => v.ViewName ==
this
.MasterViewName).SingleOrDefault().ViewType =
typeof
(NewsMasterListViewCustom);
base
.CreateChildControls();
}
}
The only thing that's left now is to build the project, and register your new widget in Sitefinity. If you're using
Sitefinity Thunder you already know that this will take not more that 5-10 seconds.Boyan Barnev is a Principal Information Developer at Progress. His mission is to demonstrate the unlimited capabilities of Sitefinity CMS via product documentation, SDK samples, and technical blog posts. He has graduated from the American University in Bulgaria and joined Telerik in 2011. Since then Boyan has held various positions in the company, leading the strategy and operation of the Sitefinity CMS Technical support service worldwide.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.