Donnerstag, 28. Oktober 2010

Never remove SharePointWebControls:TextField runat="server" FieldName="Title"



<PublishingWebControls:EditModePanel runat="server" CssClass="edit-mode-panel">
<SharePointWebControls:TextField runat="server" FieldName="Title" />
</PublishingWebControls:EditModePanel>


Why?? What was the Problem

Dienstag, 26. Oktober 2010

How to Add a ListViewWebPart to a Publishing Page

neuer Versuch das ListViewWebPart zu verstehen







Adding a ListViewWebPart to a "Publishing Page" is easy.
Create a Instance of a SPWebpartmanager, with the relevant Page-Url and get the WebPartCollection.
Create a new ListViewWebPart instance, set the ListID to the ID of SPList object you want to show.
Provide a ViewID to the Webpart and add it to the Collection, including the ID of the WebPartZone and a Sequence Number for the order within the zone.


Showing a Document Library including the "Add document" Button  isn't easy at all.
In the UI it is just a click away -> Edit WebPart ->  select ToolbarType and set it to "Summary ToolBar".
I think its almost default in UI.

[UPDATE: see adding-listviewwebpart-to-page]
If you want to use OM to add this WebPart you have to use a "hack" by modifying the schema of the used view. Which can affect also the view of the document library.
Jalil Sear describes it at his blog listviewwebpart-programatically-setting-the-toolbartype-property/


I worked around this issue by adding my own "Add Document" button to the page, having the possibillity of positioning, using audiences and renaming.

Multiselect in MultiChoice

To get a default Selection of a Multichoice Field defined in a listdefinition
use the DefaultFormula-Tag


<list>
<CHOICES>
<CHOICE>Legal</CHOICE>
<CHOICE>Tax</CHOICE>
<CHOICE>Accounting</CHOICE>
<CHOICE>Asset Liability Management</CHOICE>
<CHOICE>Shareholdings</CHOICE>
<CHOICE>Risk Management</CHOICE>
</CHOICES>

<DefaultFormula>=";#Legal;#Tax;#Accounting;#Asset Liability Management;#Shareholdings;#Risk Management;#"</DefaultFormula>

</list>

Sonntag, 17. Oktober 2010

Das mächtige Sharepoint:DelegateControl

Chiris O'Brian beschreibt die Verwendung des DelegateControls unter MOSS 2007.
http://www.sharepointnutsandbolts.com/2007/06/using-delegate-control.html

panvega erklärt das DelegateControl in seinem Blog etwas ausführlicher

http://panvega.wordpress.com/2008/10/12/sharepoint-delegate-controls/
Für Sharepoint 2010 hat sich an dieser Stelle nichts geändert.

Ruchi hat in seinem Kommentar bzgl. Parametern auf folgenden MSDN -Artikel verwiesen:







IMHO sind Delegatecontrols eine einfache aber mächtige Methode um eine Sharepoint Site um Funktionalitäten zu erweitern bzw. auch um standardkomponenten auszutauschen.
In vielen Fällen kann man statt einem Webpart ein DelegateControl verwenden