DCSIMG
SharePoint,C# - David Birin's blog

Browse by Tags

SharePoint – Events are duplicated when using templates
I encountered a strange behavior in SharePoint, this phenomenon happens when you create an event handler and attach it to a list template (for example, a document library) using a web-site level feature. If you save the list as template, the event handler reference is saved inside the list template (STP file) and when you create an instance using the template it can cause the following problems: The event handler will be activated automatically on a web site where the feature is not enabled. If the...
SharePoint – Add a SPField to all the content types in a SPList
I found out (another) strange behavior of SharePoint, I tried to add a field (a column) to a list which contain more than one content type using the following code (the new field name is “New Field”) : using (SPSite currentSite = new SPSite( "http://moss" )) { using (SPWeb currentWeb = currentSite.OpenWeb()) { SPList currentList = currentWeb.Lists[ "DocLib" ]; SPField newField = currentList.Fields.CreateNewField(SPFieldType.Text.ToString(), "New Field" ); currentList...
SharePoint - Internal field names in Hebrew
A field (sometimes called a column) in SharePoint - represented in the object model by the SPField class, has two main properties which are used to identify it in code, the Title property and the InternalName property, the reason for the duplication is that the Title property can be changed from the GUI or translated into other languages, therefore if we want to write code which can be used without recompiling after every field name change in the GUI or recompiling for different languages we will...