views:

636

answers:

4

When developing web parts in SharePoint can I inherit from the existing web parts and override their methods?

Or do I always need to start from scratch.

Many Thanks

+1  A: 

If they are not sealed, you can inherit from them. In practise, It might work or not depending on how the web part you want to extend.

erikkallen
A: 

Is there a general rule of thumb within SharePoint what classes will be sealed and which wont?

I'm specifically looking at the Site Users web part.

Thanks again

78lro
A: 

We're also looking at doing this... It looks like a lot of the web parts are sealed, which is sad. I've tried to inherit from the RSS Viewer, but I'm getting an exception, so perhaps that one doesn't really work either... :(

BTW: What we're trying to do is to create a new toolbar, with an icon to the right and no buttons. Any ideas? :)

noocyte
A: 

Most (all?) OTB parts are sealed.

A new toolbar with icon/no buttons sounds more like a design solution. Place the topnav placeholder in a invisible panel at the bottom (so page doesn't crash) and modify the rest visually (css+firebug) . Assuming I am not misunderstanding what you mean.

Its pretty easy to get started with webparts, http://blah.winsmarts.com//2006/05/14/writing-custom-webparts-for-sharepoint-2007.aspx should show you how. From there you should be able to write an RSS reader easily.

savageguy