+1  A: 

Generally you set the SPField.ReadOnlyField property to True to achieve the desired behaviour for any field. (Don't forget to SPField.Update accordingly!) There is an equivalent CAML attribute for list definitions, I believe.

That said, in your control class deriving from BaseFieldControl, you might just override the RenderFieldForInput() method and not call the base implementation to ensure nothing is rendered during Create or Edit. However, this would still render the field's table row in the form, which is probably not what you want. So to enforce the desired behaviour, use ReadOnlyField and override Update() in your SPField (not field control) class to always have it set to True.

ROXORITY SharePoint Web Parts
Sorry... Doesn't work... Or am I doing it wrong? This is what I wrote in the SPField class:public override void Update() { this.ReadOnlyField = true; base.Update(); }
ashwnacharya
Try just setting the property in all your constructors, completely ignoring Update() calls or overrides. (Don't Update() in your constructor for sure!)
ROXORITY SharePoint Web Parts
Tried... Nope.... The Row in the Edit page still renders; what's worse, it stops updating the value of the field. The value doesnt change when I change the value of the field which it looks up to..
ashwnacharya
By the way, it might be better to set the ShowInEditForm and ShowInNewForm properties -- I recall sometimes ReadOnlyFields could not be edited from the List Settings page!
ROXORITY SharePoint Web Parts
Got it working?
ROXORITY SharePoint Web Parts
A: 

It might be easier to just change this on a list-by-list basis by going to the Advanced section of the List Settings, setting Allow management of content types? to Yes, and then editing your content type to change the value of your field to 'hidden'.

Andy Mikula
A: 

Take a look at this blog post. I think it will give you some ideas. The concept uses different rendering templates based on the mode.

http://sharepoint.nailhead.net/2008/04/creating-rendering-template-that.html

JD
A: 

Did you try and set the field as hidden? http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.hidden.aspx

Custom FORMS pages for new item and edit item (NewForm.aspx and EditForm.aspx) would be another way to achieve this.

Anders Rask
Wouldn't this also hide the field on display forms, which is not wanted? I can only re-emphasize ShowInEditForm and ShowInNewForm with regard to the OQ ;)
ROXORITY SharePoint Web Parts
A: 

Try this too, How to hide columns in SharePoint

sara