Copyright @ 2013 Nizar Joober - I'm SharingPoints. Designed by Templateism
SPWeb web = //[Get your web] SPList MyList = Utilities.CreateList(web, Title, Key, SPListTemplateType.GenericList);
// Add RichText column string htmlFieldName = Utilities.AddField(MyList, SPFieldType.Note, FieldName, false, true); SPFieldMultiLineText htmlField = MyList.Fields[FieldName] as SPFieldMultiLineText; htmlField.RichText = true; htmlField.RichTextMode = SPRichTextMode.FullHtml; htmlField.Update();
// Rename the original Title column SPField TitleField = MyList.Fields[SPBuiltInFieldId.Title]; TitleField.Title = anOtherName;
[Guid("xxx")] public class MybEventReceiver : SPFeatureReceiver { public override void FeatureActivated(SPFeatureReceiverProperties properties) { SPWeb web = //[Get your web] SPList MyList = Utilities.CreateList(web, Title, Key, SPListTemplateType.GenericList); // Rename the original Title column SPField TitleField = MyList.Fields[SPBuiltInFieldId.Title]; TitleField.Title = anOtherName; // Add RichText column string htmlFieldName = Utilities.AddField(MyList, SPFieldType.Note, FieldName, false, true); SPFieldMultiLineText htmlField = MyList.Fields[FieldName] as SPFieldMultiLineText; htmlField.RichText = true; htmlField.RichTextMode = SPRichTextMode.FullHtml; htmlField.Update(); } }
Posted By: