spfield

Problem adding field to a custom list type in SharePoint

I have defined a custom list template type for SharePoint. I install it using VSeWSS 1.3 and everything seems to behave correctly. I have added a custom action which will add additional columns (SPFields) to the list. However, every time that code executes it throws and ArgumentException with a 'Value not in the expected range.' error m...

What control from InfoPath 2007 maps as SPFieldLookUp or SPFieldLookUpCollection field?

Hi. Does anyone know what control from InfoPath 2007 maps as SPFieldLookUp or SPFieldLookUpCollection field in SharePoint? Any idea is accepted. Thnx. ...

SPField custom attributes in schema

I'm trying to decide whether it is possible to store custom attributes in a SPField's schema XML. If you look at the .xsd for the 'Field' element in SharePoint, there are a slew of attributes. The last one in the attribute list is <xs:anyAttribute>. This elements purpose is to allow it be extended. This obviously leads me to believe it...

Non-empty fields are empty in word

I have created a multicolumn custom field and deployed it in SharePoint. To be able to use the field values from my custom field I also deployed an event receiver to copy the three values from my custom field to three separate regular text fields. If the three text fields do not exist I create them with XML in code. I also make sure the ...

need to write code behind for attachment field from display page of custom list

I have created custom list and modified display form for dispaly attachemet image of list. I want to dispaly attachement from code behind then what code I do need to write. I want to show attachedment field as well image. I tried with AttachmentsField, SPField and SPFieldAttachments but I couldn't compile code successfully. I don't hav...

Problem with DisplayPattern in SharePoint 2010?

I am adding a new field to a list using the AddFieldAsXML method of SPFieldCollection. The method executes fine with no problem. And the column header shows up when I view the list; however the value never displays in the column. Here is what the field looks like after it has been added to the list. This xml is a snipped from the lis...

How to get all possible values for SPFieldLookup

Hello! I have a lookup field in sharepoint which just references another list. I wonder how do I programatically enumerate all possible values for this field? For example, my lookup field "Actual City" refers list "Cities" and column "Title", I have 3 cities there. In code I would like to get list of all possible values for field "Actu...

Get a reference to current Listitem from within custom SPField

I've successfully created a custom field inheriting from SPFieldText and happily have complete control over rendering it on the input form as a control. Problem: I have a need to create a link to a popup with the ListId and ListitemID in the querystring when rendering the field using GetFieldValueAsHtml(). Something like this: public...

SharePoint Custom Field - is it possible to handle item deletion event?

I'm expanding SPFieldText and BaseFieldControl to create a custom field. The field saves some data externally (for example, on a database or on another list) Within the control I'm able to handle Edit and New events (using ControlMode). I'd like to run a function and clean up some data when an item containing my field is deleted. Is t...

WSS3 - setting a default value on a SPFieldType.Boolean after creation

I'm using WSS3 and C# to create site and I am creating a class to change fields on lists after they have been created. I have already created an SPField.Boolean type with no default value, but after upgrade I need the default value to be set to true. My current code that does not work follows: //web is already defined as the...

Programmatically setting field value for sharepoint listitem

Hi guys. I'm trying to simply add a simple text or hyperlink field to a list item in sharepoint 2007. I can add the field no problem: list.Fields.Add("MyField",SPFieldType.Text, false); And it shows up fine on my list items. However no matter which way I try, I can't programmatically set a value for the field. I tried: list.items[0...

Programatically changing field order in Sharepoint 2007 list

I'm adding in two new fields into an already existing Sharepoint list programmatically through a feature. The fields are being added successfully but I have been unable to adjust the column order. This task is done simply through the UI by going to List Settings and then Column Ordering, but I have been unable to achieve the task progra...