Tag Info

Hot answers tagged

17

It sounds like you've gotten two concepts slightly muddled. There are three entities that are important here: A field/column on a list (SPField and its derivatives, including SPFieldUser) A row of data (SPListItem) A data item (string, SPUser, etc. according to field type) Each row of data (List Item) has a data item for each of the fields, but fields ...


8

To achieve true column level security in SharePoint, I work with two lists and create the column as a lookup. This way, I can set specific permissions on the lookup source (e.g. read only or even access denied). It requires more effort than a single list, but as far as I know this is the only way without server-side code. But in case of only a single ...


7

That could be due to localization. In that case, you should also set TitleResource property: field.TitleResource.SetValueForUICulture(new CultureInfo(1033), "My title"); Actually, I've done renaming of Title plenty of times, and I can't see any difficulties there. Your SchemaXml approach probably didn't work for the same localization reason. By the way, ...


6

You could use an item event receiver that prevents the value from being changed. Something like this: public class EventReceiver1 : SPItemEventReceiver { public override void ItemUpdating(SPItemEventProperties properties) { if (properties.ListItem["Guideline"] != properties.AfterProperties["Guideline"]) { ...


6

Create custom list, and then enable attachments from List Settings -> Advanced Settings. This will automatically add a column of type Attachments to the list. But there is no way to have two columns of such type in a list.


6

Open the AllItems.aspx page for the specific list. Search for the <ViewFields> tag List item LinkToItem="TRUE" to whichever column you want the link: < ViewFields> < FieldRef Name="Attachments"/> < FieldRef Name="LinkTitle"/> < FieldRef Name="linkThisColumn" LinkToItem="TRUE"/> < FieldRef Name="data_x0020_column"/> < FieldRef ...


5

Numeric formats are determined by your locale settings. So, for instance, if you are using locale 1033 (en-us), you'll see numbers displayed with the comma separator by default. You can change your locale settings, but that will change the formatting at the level where you make the change. Otherwise, a calculated column or a DVWP are ways to go, as Eric ...


5

i found the solution. it's really simple: SPList list = site.RootWeb.Lists["Tasks"]; SPField field = list.Fields["Priority"]; field.ListItemMenu = true; field.ListItemMenuAllowed = SPField.ListItemMenuState.Required; field.Update(); list.Update(); and that's all.


5

You can do this programmatically or through PowerShell, setting SPField.Hidden property to false. Tentative PowerShell script: $web = Get-SPWeb http://localhost $list = $web.GetList("/Lists/Test") $field = $list.Fields.GetFieldByInternalName("Created") $field.Hidden = $false $field.Update()


5

You can do it in InfoPath, cascading drop downs. But since you said you need to do it in jQuery, there is a very useful library, called SPServices, available to assist. Marc has created a function in the library to do cascading drop downs, which is exactly what you want. Look over that information and see if it's helpful.


5

Couple of questions: What column data type are you using? What column validation formula are you using? Just to be sure, are you using the OOTB column validation feature and not some custom validation feature? If so, did you specify the user message property? I am able to create a simple number column, and set a validation formula as follows And, when ...


5

I am assuming you provisioned the column as a site column. So, the next thing is to make sure to push the changes to the down to lists and content types where this site column has been referred (which apparently you haven't done it). So, I would recommend to delete the old definition and provision the column again! See an example below where I am using the ...


4

SharePoint has no ability to assign meta-data to a Site Collectin or site directly. There are a few approaches to simulating it for the purposes of search and navigation: 1 - Use the Site Directory. although the 2007 Site Directory was deprecated, it still exists on SharePoint 2010 (for upgrade compatability) and you can turn it on and use it the same as ...


4

SharePoint indeed converts spaces to _x0020_ for internal names, because this is supposed to represent the url encode %20 (aka space). Because of this reason, you should prevent using spaces in field name (and staticname), as you've mentioned yourself. You can keep spaces in the display name. In code fragments you can also use: XmlConvert.EncodeName = ...


4

You are unable to change the types of Columns in SharePoint lists - simply because it's impossible to guarantee how to transform the data stored in one column type to another. What you can do, is create your Yes/No column, go to DataSheet view, and see if you are able to copy/paste the values from your calculated column over to the new Yes/No column.


4

The simple answer is that you can't. You have document libraries to store and interface with files and their respective metadata, and list attachments to attach files to specific list items. Is there a specific reason why file attachment doesn't work in your scenario? You could likely modify the way the list attachment is presented to the user so the ...


4

Alex C! You can customize xslt layout of view by using SharePoint Designer. You can define variable <xsl:variable name="ronwNumber">0</xsl:variable>, increace `<xsl:variable name="ronwNumber" select="$ronwNumber+1"/> it inside tag <xsl:foreach></xsl:foreach>that displays rows and add column to layout table ...


4

You are mixing up the object and it's XML schema. There is no DisplayName property on the SPField object and it's derived types. In a field's XML schema, there is a DisplayName attribute but no Title attribute. So, what you have is: SPField.Title (Corresponds to XML Attribute DisplayName) This returns the localized name of the field. In effect, if your ...


4

Turns out I had made a wrong assumption. I thought the formula used the internal name of the field, but it actually uses the DisplayName. So either changing DisplayName to TestDate or changing the formula to TEXT([Test Date],&quot;MMMM&quot;) will fix the problem for me. It caught me out for so long because I had copied the fields out of an exported ...


4

No, there is no attachment column type. You have a few options: 1) Simply use list attachments. No way to make them required, but they are there. 2) Use InfoPath. In an InfoPath form you can add an attachment field that allows a user to embed their attachment in the form (doesn't go to a SharePoint column, would need to open the InfoPath form to view ...


4

There is no way OOTB using the UI. So you have to do it manually in the UI or through code (could be PowerShell). If you create the column in the UI and deselect 'Add to Default View' and then run the following in 'SharePoint 2010 Management Shell': $web = Get-SPWeb "http://sharepoint" $list = $web.GetList("http://sharepoint/Lists/MyList") $field = ...


4

On the SPField object, you can use the ShowInEditForm property to get/set whether or not to show it on the default Edit form. See MSDN for the reference: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfield.showineditform.aspx


4

It is because SharePoint Multilingual User Interface (MUI) translates also column titles. What you did was that you overrode the default English MUI translation of the Title field to "title123". However, when you switch over to German MUI, it will use the German default translation of the Title field. You would need to change it also on the German MUI side. ...


3

I completely agree with @Marc D Anderson and @Matt Weimer. You can use JavaScript to help with the UI presentation and an event receiver to enforce the values server-side. As for the JavaScript portion, I suggest taking a look at SPUtility.js (full disclosure, I maintain this open source library). It allows you to do the following: <script ...


3

var list = web.Lists["Order List"]; var targetList = web.Lists["Country List"]; var fieldName = list.AddLookup("Origin Country", targetList.ID, true); var field = list.Fields.GetByInternalName(fieldName) as SPFieldLookup; field.LookupField = targetList.Fields["COUNTRY"].InternalName; field.Update();


3

Another option is to use an Integer field type, rather than a Number field type. Unfortunately you cannot create an integer field through the browser, but it's pretty easy to do programmatically Here's a short powershell script that will do the trick $web=get-spweb http://urltosite $list = $web.Lists["MyListName"] $list.Fields.Add("MyIntFieldName", ...


3

You can add these options to Field xml - LinkToItem="TRUE" LinkToItemAllowed="Required" ListItemMenu="TRUE" to display Item Context Menu. So it looks like: <Field Type="Text" ID="{87AC637E-BB54-48A4-BB7A-93973F6814A1}" StaticName="Country" LinkToItem="TRUE" LinkToItemAllowed="Required" ListItemMenu="TRUE" ClassInfo="Menu" ...


3

The blog post rendered by xslt transformation. In this case you should change XSL template for your posts in 14\TEMPLATE\LAYOUTS\XSL folder. You can use this post as start point to understand how does it work.


3

SPFieldChoice has a property named FieldRenderingControl. Using reflector you can find this code in the FieldRedneringControl property: .... switch (this.EditFormat) { case SPChoiceFormatType.Dropdown: control = new DropDownChoiceField(); break; case SPChoiceFormatType.RadioButtons: control = new RadioButtonChoiceField(); ...


3

Add the following property to ArrayOfProperty <Property> <Name>IsPathRendered</Name> <Value xmlns:q7="http://www.w3.org/2001/XMLSchema" p4:type="q7:boolean" xmlns:p4="http://www.w3.org/2001/XMLSchema-instance">true</Value> </Property>



Only top voted, non community-wiki answers of a minimum length are eligible