Im using SharePoint 2007. Created a custom field for a SharePoint list, which should not be displayed during Item Add or Edit. I have used SharePoint WSP Builder Project in Visual Studio 2008. Created a custom field type. Is as below:
<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
<FieldType ShowInEditForm="FALSE" ShowInNewForm="FALSE">
<Field Name="TypeName">****</Field>
<Field Name="ParentType">Text</Field>
<Field Name="TypeDisplayName">****</Field>
<Field Name="TypeShortDescription">****</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="Sortable">TRUE</Field>
<Field Name="AllowBaseTypeRendering">TRUE</Field>
<Field Name="Filterable">TRUE</Field>
<Field Name="FieldTypeClass">**.**, PDFDisplay, Version=1.0.0.0, Culture=neutral, PublicKeyToken=****</Field>
<Field Name="FieldEditorUserControl">/_controltemplates/****.ascx</Field>
<PropertySchema>
.
.
<PropertySchema>
<RenderPattern Name="DisplayPattern">
.
.
</RenderPattern>
</FieldType>
</FieldTypes>
Even though the ShowInEditForm and ShowInNewForm is set to FALSE, it is displayed when either adding a new item to the list or when editing an item.
In the Field's Control class's constructor set the two properties to false
field.ShowInNewForm = false;
field.ShowInEditForm = false;
Still is visible in the edits and item adds..