Represents a field in a list on a SharePoint Foundation Web site.

learn more… | top users | synonyms

1
vote
1answer
303 views

Update field by code behind

I have an existing list with a text field and records in it. Now I want to change that text field into a calculated field to make it concat two other text fields in the list (possibly by changing the ...
1
vote
1answer
1k views

How do I get values of fields from custom lists?

I have a custom list ("Contacts") as well as a web part with forms. I want to take the custom list fields and map them to the web part form. My problem is getting the values from the custom list. I've ...
1
vote
1answer
111 views

What are the largest and smallest values that can be stored in an SPFieldDateTime?

What it says on the tin, basically! I assumed it's the same as a regular .NET DateTime struct, but whenever I try to store 01-Jan-0001 (smallest DateTime value), I get an error. Can't find it on MSDN ...
0
votes
1answer
2k views

BaseFieldControl in SPControlMode.Display not display correct values

I'm creating my own Display Form based on a view in a webpart. I'm getting the list (Document Library), and view, and then iterating through the fields, and creating a BaseFieldControl and then adding ...
1
vote
1answer
849 views

What type is Number field?

I have a Field, that has Type="Number". What type of variables can I assign to it? Will the field support float or double? oListItem["numberField"] = data; What type can data be? Cross posted from ...
0
votes
1answer
387 views

Changing SPField cause no changes

I try to change an SPField after SPList creation, but I'm not getting any results of that change. using this code: SPField oSPField = oSPList.Fields[new Guid("MyFieldGuid")]; ...
2
votes
1answer
429 views

Get all lists and sites using a given site column in sharepoint 2007 using powershell

In other words, is there a SPField.ListsFieldUsedIn() equivalent in SharePoint 2007? Ref: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.listsfieldusedin.aspx
2
votes
1answer
339 views

Have different column title in Edit View form and view itself

I'm using C# code to automatically create a read-only Note column that is a truncated version of an existing Note column. list.Fields.Add(field.Title + " (truncated)", SPFieldType.Note, false); At ...
1
vote
1answer
168 views

Custom field type - how inherit attributes from base field type

I need to create custom field type which must inherit ATTRIBUTES from inherited field type (e.g. Note). I know how to add custom attribute on my custom type (using fldtypes...xml, custom ascx,...) ...
3
votes
3answers
420 views

The CHOICE element contains the value within its body. What gives?

As stated on MSDN, the CHOICE element contains the value within its body. That means that in a field, if I have: <CHOICES> <CHOICE>foo</CHOICE> ...
2
votes
1answer
736 views

SPFieldMultiLineText.UnlimitedLengthInDocumentLibrary = true

We are running into problems with the 255 character limit on a multiline text field in a document library. I can change the setting to allow unlimited length, but the following warning is displayed: ...
8
votes
2answers
878 views

Localization on a SPField created in code

When you declare a SPField in CAML, you can add the localization in the code: <Field ID="{57258F13-19B2-4A97-B244-090845B5C4AB}" Type="Text" Name="Partner" ...
3
votes
1answer
311 views

Placing CompositeFields for multiple list items on one form doesn't work as expected

In a workflow task, in custom edit form, i use CompositeField to render relevant fields current task item and for workflow item by setting a different context for CompositeField. However if i put ...
0
votes
1answer
525 views

Custom Field value not visible on a view

I have created a custom field based on SPFieldUrl. What I want, is basically just a normal Url field functionality, but I don't want it to be visible when new item is added to the list (a webpart is ...
3
votes
1answer
1k views

SP2010 Relational Lists - User Objects show “#VALUE!” instead of value

I know I'm just doing something wrong here but after I create a SPFieldLookup object, attaching to content type, and then adding to list, all looks fine. I then add an item to the parent, which in ...
2
votes
2answers
699 views

Why do I get a security validation invalid error updating a field from a feature receiver?

Trying to change the title field of a document library to be required..doesn't want to work. SPList docLib = web.Lists["Process Aids"]; SPField field = docLib.Fields["Title"]; field.Title = "Display ...
1
vote
3answers
1k views

Multilanguage fields in programatically created list

If I'm creating a custom list in my code, how can I make fields localized, so when user has set e.g. Polish, he can see field names in polish and when he has English language set, he can see field ...
3
votes
7answers
5k views

ArgumentException when trying to access SPListItem value

I have a tool to update all items in SP (link replacement). The tool works most of the time but sometimes it throws me an ArgumentException ("Value does not fall within the expected range."). Here is ...
10
votes
2answers
12k views

How do I convert SPUser to SPFieldUser?

I have a field in a list that accepts an SPFieldUser object. I have an SPUser object that I would like to populate that field with, but I cannot implicitly convert from one to the other. How would I ...
1
vote
2answers
3k views

How to have a column contain multiple users

I have a list with various columns. One of those columns is to store users. However, when I use the code configurationListFields.Add("Limit_Access_To", SPFieldType.User); I am only allowed to ...
1
vote
1answer
1k views

How to make field text bold in custom edit form?

I am already using custom field iterators to customize the fields on my list forms. When users are creating or editing a list item, I want certain field names to show in bold. For example, when users ...
9
votes
3answers
3k views

Is there a way to see if an SPField was created by a user?

I have some code where I am going through all of the Fields that belong to a content type. I'm curious if there is a way to check to see if the SPField was created by a user or if it is a system ...
2
votes
2answers
1k views

SetCustomProperty within OnSaveChange

Saving Custom Field Type properties using SPField.SetCustomProperty within the IFieldEditor.OnSaveChange event does not seem to work, for reasons explained elsewhere. I've seen all kinds of bodges ...
6
votes
4answers
27k views

How to set ListItem Lookup Field value

How do I set a ListItem's Lookup field using code? SPFile file = list.RootFolder.Files.Add(destUrl, iStream, true); SPListItem item = file.Item; item["DocumentID"] = DocID.ToString(); ...