.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Programmatically change DisplayName/ Title for custom content type

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :SharePoint

I've created a custom content type with the following code.

if (currentWeb.ContentTypes["My Content Type"] == null)
  var myContentType =
    new SPContentType(currentWeb.AvailableContentTypes[new SPContentTypeId("0x01")],
              currentWeb.ContentTypes, "My Content Type");


After that I add this content type to a generic list. If I now click on "New element" on my list ribbon I can add a new item with displayname "My Content Type". How can I change this value as I want to name my content types like "xxx content type" but don't want to see "xxx content type" in the "New element" action.

I expected the name of the content type to be some kind of internal and I'm looking for something to be change the displayname or title to be able to display something different. If I didn't made myself clear, I'll try to be more explicit. Thanks in advance.

View Complete Post

More Related Resource Links

Unable to change content type from doucment type to custom type



I have a document library with two content types (1. Document and 2. custom). When i try to change the content type from document to custom it is not allowing me to change.

Actions-->Edit in datasheet -->Selected content type column--> clicked dropdown--> changing to custom (Once i click to custom after that it is automatically changing back to document)



Create a list definition without a Custom Content Type

is it possible to create a list definition without creating a custom content type?  I want to create a list definition and select "Custom List" and then I just want to add fields to the custom list and not create a content type that will show up in the SharePoint GUI.  Seems like to get the new fields to show up in the new and edit forms I have to add the fields to a custom content type.

Retreive content type of a list programmatically

Hi everyone,   I need to retreive all active SPContentType of a list. My list is configured to NOT allow the creation of "new folder" under the new button.   However, when I call the SPList.ContentTypes property, the SPContentType "New Folder" is always contains in the resulting collection... even if the SPList.EnableFolderCreation is set to false? Q.1. It's normal? Q.2. If yes, how can I differentiate the "New Folder" content type and all the others content type?   Thanks all   Marc          

Inserting a custom list form for a custom content type

Hello, When I try to insert a custom list form for a custom content type I created, nothing happens. Same thing is for the content type "message" & "discussion". I already cleaned up my profile (http://blogs.msdn.com/b/spdsupport/archive/2008/07/03/how-to-fix-custom-list-forms-will-not-insert-or-show-up-on-the-design-surface-of-sharepoint-designer.aspx) I use MOSS 2007 version and SP designer 2007 SP2 on Win7. Below you can see an example of the custom content type.     Columns Name Type Status Source Title Single line of text Required Item Segment Lookup Optional   Form Lookup Optional   Main Product Lookup Optional   Weight Number Optional   Price/Kg Currency Optional   Unit Price Currency Optional   Manufacturer Lookup Optional   Packaging Lookup Optional   PL Yes/No Optional   Label Lookup Optional   USP Lookup Optional   POSC Lookup Required   Place Lookup Hidden StoreCheckHeader Country Lookup Hidden StoreCheckHeader SC_Link Single line of text Hidden StoreCheckHeader

BCS Method Security / External Content Type Permissions / Custom List Security Provider / Security T


I have an external list setup with the usual CRUD methods.  The external SQL table is also being populated by another source.  I want to enable/disable deleting depending on whether the record was created from SharePoint.  I would also like the normal list permissions to work.  So if a user has permissions to delete on the list, they can only delete items created for SharePoint. 

Where should this logic be incorporated?  On the BCS Delete method, somewhere in the External Content Type or on the list instance?  Most examples I find relate to security trimming for search.  I'm only concerned about the delete method.

I'm sure there are multiple ways to accomplish this.  Which is the best?


Custom Action for specific External Content Type List


I have an External Content Type list instance feature in Visual Studio. Deploying the instance works fine. However, I can't create a custom action using RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Even if I specify the list Id as follows RegistrationId="{8F595340-5D08-4287-8BF6-30D50989D2F4}" or RegistrationId="8F595340-5D08-4287-8BF6-30D50989D2F4" I get nothing.

However, RegistrationId="600" works fine, but for all External Content Type lists.

I added the custom action with SharePoint Designer and it works as expected. When I generate a site template and import it into Visual Studio, the custom action uses RegistrationId="{$ListId:Lists/yourlistname;}" RegistrationType="List"

Creating a new site based on the site template creates the custom action correctly. However, deploying just the custom action does not work (feature deploys, but no custom action appears). I also tried RegistrationId="0x0100D67E541CC4BB6A4A9D62D22657ECFF68" RegistrationType="ContentType" with no luck. The content type id was pulled from the list instance using the object model.

I have to tie the custom action to a specific list instance. Because the li

Unable to attach a custom SharePoint Workflow to a Content Type


I am working with SharePoint Server 2010 Beta 2, Visual Studio 2010 Ultimate RC and SharePoint Designer 2010 Beta.

I built a custom Content Type based on the Item type with a few custom site columns. I also have built a custom Sequential Workflow using Visual Studio 2010. This is a relatively simple workflow that creates a task, waits for the task to complete, sets the workflow to complete. I am able to deploy this workflow to the site collection through VS 2010.

The problem I have is that when I try to associate my custom Content Type with my custom workflow, that workflow is not listed in the workflow templates to select. There are only the OOTB SharePoint workflows to choose. However, if I create a list and associate a workflow to that list, my custom workflow is listed in the workflow template list.

This makes sense since at the start of building a custom workflow in VS2010, one of the first questions is whether the workflow is a Site or a List workflow and I selected List.

I did a little research and found some who wrote that Reusable Workflows may be attached to Content Types.  In VS2010, there is no option to build a Reusable Workflow.  That is only possible in SharePoint Designer.  However, it is possible to import a SPD workflow into VS, so I tried that.  Imported the WSP into VS201

Custom Workflow TaskEditForm(Custom Content Type) not getting displayed in Tasks List.



I have developed a custom sequential workflow. I have also developed a custom content type derived from Workflow Task Content Type.

I have 1 TaskEditForm.aspx in this custom Content Type. The custom Content Type is getting associated with the Tasks List but when I click EditItem option in ECB Menu or Ribbon,the in-built EditForm.aspx gets displayed instead of displaying my custom TaskEditForm.aspx from the custom Content Type.

Can anybody help?


Regards,Gautam Kaikini, SharePoint Developer. http://in.linkedin.com/in/gautamkaikini

cannot register custom edit form through a content type and deploy it as a feature


custom edit form through a content type and deploy it as a feature.. the RTM version of sharepoint 2010 does not register the custom forms. the elements.xml is pretty straight forward..

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <!-- Parent ContentType: Workflow Task (0x010801) -->
 <ContentType ID="0x010801007fc29cb23c2049c3985ccdb95fc8331f" Name="ReviewTask" Group="Content Types" Description="Review workflows task purpose" Inherits="TRUE" Version="0">
   <FieldRef ID="{2C2BE3C6-0EB6-4F53-B612-CF49A7EF4013}" Name="Review Status" />
   <FieldRef ID="{CE1D0566-DDC6-4AA3-80C2-6CEA892F105E}" Name="Review Date" />
   <FieldRef ID="{07CB9AA2-0102-4741-9F9A-AC4A7D62D769}" Name="Review Comments" />
   <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">

Problem while creating task with custom content type in sharepoint workflow


Hi all,

I am trying to create task with custom content type in sharepoint statemachine workflow. But it is showing "Error Occured" after task creation code is excecuted. can anyone tell me what is the problem.

Task Content type


  <ContentType  ID="0x01080100A707C0079E8547c0A87515457DB90629"
      Description="Workflow Task"
      <FieldRef ID="{9da97a8a-1da5-4a77-98d3-4bc10456e700}" Name="MyComments" DisplayName="MyComments"  />
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
        <FormUrls xmlns="

Content Type Title on Newform.aspx

I have a Calendar created with 8 Different Content types in it which are derived from Calendar Event and List item. In the Newform.aspx based on content type ID respective fields are present.
My Question is there a way to display Content type Name on Newform.aspx so that user's will come to If there are filling right now or not.

Icon for custom content type



I could not find anything concerning custom icons for content types. I have defined a custom task content type and now I want to assign a custom icon for it. The only way to set item icons I know is to edit the DOCICON.XML, but I do not have a file extension here.

Is there a way to do it programmatically?

Cannot Display Application Page as Custom Form for Content Type



I've created a custom content type in VS. In "Elements.xml" file of my content type, I added my custom application page as new form and deployed as feature.

   <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
    <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">

how to create a custom task content type for VS2008 workflow



i want to create a WorkFlow by VS2008 and i want to use custom content type for the tasks, and i want to build this cutome content type by Aspx form but i don't know how, any ideas ??


Thanks for all.

Change the content type for multiple list items


I have a document library which is configured to manage content types.  Users will be expected to upload multiple documents into the library.  Then they will be expected to choose the content type of the file and fill in the required metadata.  The only difference in these content types is the template which will be used to create new files of the specific content type so the columns are identical for each content type.

I have created a public view with inline editing enabled but Content Type is not an editable field.

The problem I have is that when I enable Inline editing, the users don't have an opportunity to select the content type, even though the files have just been uploaded and have not been checked in.

My question is this; how can users change the content type of multiple items without having to go through the complete New Item form? 

With literally thousaands of documents to be imported, having the users fill out a separate form for each document when many will have the same column values is a show stopper for our rollout.  It will take too much time.  The project will be a failure. 

I've also tried to create a datagrid view but the same problem exists.  Content type is not an editable column value.

Thanks for helping.


Custom ribbon button on content type not shown in XsltListViewWebPart


Hello all,

As a bit of background: I'm currently busy developing a content type with some kind of status (waiting / in progress / done). I want to make the users life a bit easier to complete an item so I want to add a button to the ribbon that sets the selected items status to "Done".
This works when I go to the list and click on the item (I see my button and it works perfectly). The problem is that this button is not visible when I add a view of this list on the homepage, then suddenly my button does not show.

Does anybody know what can be done to also show the button inside the ribbon of the XsltListViewWebpart? Below is my elements.xml that I use.


<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  Title="Add a Ribbon Button">
     <Button Id="Ribbon.ListItem.Actions.NewRibbonButton"

How to create a custom content type with own custom view ,add, edit and delete form in sharepoint fo


How to create a custom content type with own custom view ,add, edit and delete form in sharepoint foundation server 2010 using visual studio 2010?

I donot want to use default form "form.aspx".

we can use my custom form in place of "form.aspx"?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend