Tag Info

Hot answers tagged

19

There's an out-of-the-box way to remove the 'Add new item' link. If you edit the webpart properties using the 'Modify Shared Web Part' command, you'll find the 'Toolbar Type' dropdown in the 'List Views' section. If you choose 'No Toolbar' there and save the page, the footer link will be gone. No code required, no unghosting/customization. But you'll have to ...


18

The most efficient way to a lot of transaction in SharePoint is using of SPWeb.ProcessBatchData method. For deleting operations there are very helpfull post. Code exaple from that post: // We prepare a String.Format with a String.Format, this is why we have a {{0}} string command = String.Format("<Method><SetList ...


17

Although in most of the UI and API they can be manipulated the same way, there are some significant differences between Lists and Libraries. The latter is a specialized type of the former. Lists: Can have attachments Have major versions only Do not have Check-in/Check-out features Libraries: Cannot have attachments (files are directly in the library) ...


16

No No No No No No Yes, apparently: Create a view and select a Sort By column, then set that view as the default view The DataSheet view does not play ball. The problem is that the DataSheet view is a Microsoft Access generated data table, so there are none of the usual SharePoint hooks for interacting with it. Here are some more related questions: ...


16

This is related how instance of SPListItem is being created. Actually in both cases new item is added to the collection of items in list, in first case new item is added explicitly, in the second one implicitly. The point is, that for initializing collection of items in list is used the same method GetItems but with different queries. ...


13

In addition to your "Deactivated" field, create a Calculated field named "ActiveTitle" (or whatever you want to call it). Use the following formula: =IF(Deactivated,"",Title) The ActiveTitle field will be empty when the Deactivated field is set. When you configure your lookup column, tell it to use the value from ActiveTitle instead of Title. Empty values ...


11

I had the Similar Issue. You need to do that same thing for the LinkTitle as well to get Name in the Default View. Though in the <ViewFields> <FieldRef> tag you have an option for DisplayName it didnt work as expected. Only way I found is to <Field Name="LinkTitle" DisplayName="Serial Number" Type="Text" />


10

As Sean says one option is to make a template, and create a new list using that. http://grounding.co.za/blogs/neil/archive/2008/10/05/moving-a-list-with-content-between-sharepoint-servers.aspx If its simple you can perhaps use the DataSheet view to copy and paste the data to the new list if you've already setup the structure. You can IIRC do a ...


10

Yes this can be achieved by using an SPSiteDataQuery. See: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsitedataquery.aspx. This will require some programming. If you do not want to develop against the SharePoint Object model, then use the Content Query Webpart (requires SharePoint Publishing Infrastructure feature activated). You will ...


10

You can associate your custom action to a specific list by using the RegistrationId property. Example: <CustomAction ControlAssembly="MagicalProject.Actions" ControlClass="MagicalProject.Actions" ControlSrc="/_layouts/MagicalSite/MagicalPage.aspx" Description="This is my custom action which does magical ...


9

Just to be clear: title is only "mandatory" if you create lists using the GUI. When you provision your own list using code or CAML you can create lists without Title. If you insert the formula =Me&" - "&TEXT(Today,"dd-mm-yyyy") into your calculated value, you should get something close to what you want. Be aware though that at any time the user ...


9

Q: Is there a max number of columns in a sharepoint list? A: SharePoint Server 2010 capacity management: Software boundaries and limits / Column limits Q: Can we use reporting services to read from two lists? A: Yes: if you are using SQL Server 2008 R2 reporting service Q: Is it possible to display information from two lists in a single view even if the ...


9

You should recreate context. SPSecurity.RunWithElevatedPrivileges(delegate() { using(SPSite site = new SPSite(properties.SiteId) { using(SPWeb web = site.OpenWeb(properties.Web.ID) { //code } } }); //Edited for this bracket


8

I like IAfanasov's response. ProcesBatchData is the way to go. But you are asking about the "most efficient way to delete all the items of a large list". The most efficient way is to delete the list and re-create it, if you really want to delete all items. It will be a lot quicker than doing any iterative actions.


8

You can find list template ID in Visual studio by looking at Schema.xml but you won't going to find list ID. To get list ID you can use this code in VS, localhost.Lists ls = new WebApplication3.localhost.Lists(); ls.Credentials = new System.Net.NetworkCredential("sunil", "password"); ls.Url = "http://mossserver/_vti_bin/Lists.asmx"; var lsturl = ...


7

You cannot import an iqy file. It just defines the query for Excel. The only way would be to import the data in excel using the web query and then import (the imported) data from the sheet into the list. Another approach would be to use Excel Services but I think you need to enable the external datasources then (not sure).


7

You can use the sn tool to find the PublicKeyToken for your application. Simply build the assembly and use sn -T <assembly name> If you are using SharePoint 2010 tooling you could also use $SharePoint.Project.AssemblyFullName$ In your code to insert the current assembly name at build time


7

Assuming you have instance of SPList in powershell, the BaseType of list would be SPBaseType.DocumentLibrary for list of type document library. So that check may look like if (oListObject.BaseType -eq [Microsoft.SharePoint.SPBaseType]::DocumentLibrary) { }


7

Have you taken a look at the business data catalog (BDC) on moss 2007? The BDC (renamed Business Connectivity Services in SP2010) is an out of box feature enabling external business data (in your case a list of offices) to be surfaced within SharePoint site collections without writing any code. It may not be the perfect fit for your requirements, since if ...


7

You can also add the following line for each <row>: <Field Name="ID">1</Field> For example: <Row> <Field Name="Title">DevScanner</Field> <Field Name="ID">1</Field> </Row> As the ID is still the same it won't add a new record, so it prevents duplicate rows.


7

The approach of deleting the list and recreating the list is the fastest & most efficient (since you are deleting all the list items) - Get-SPWeb $FooUrl | % { $_.Lists.Delete([System.Guid]$_.Lists["FooList"].ID) } The above deletes the list and you can then recreate the list with its template, etc.


7

Any kind of hardcoded path is, in general, opposite from best practice so opening a SPWeb or SPList object directly from its full server URL is a no-no. To get the SPWeb object, if you are sure your code will always run in your desired web it is perfectly okay to use SPContext.Current.Web. In all other cases, you might want to look at something like the ...


6

Depending on the tasks, there are ways to use SharePoint Foundation Remote Procedure Calls (RPC) in combination with Collaborative Application Markup Language (CAML) to create batch operations on lists. This includes deleting, updating, adding and other commands. There is an article covering this here. This can also be done from code. Examples here and ...


6

You cannot create a list within a list, but you can create a lookup to another list. This exists a column such that each item has a reference to another list. Thus, you can have a task list with a lookup column to your list of projects. In your rollup, you can group by this lookup column, and even filter by it, to show custom views.


6

First of all, quickly learn that any SharePoint Development should not talk to the database directly, especially with SQL Queries. SharePoint has a fully-featured and very robust API framework for getting data in and out of SharePoint Lists, and (although it is a steep learning curve), it's just the way development is done in SharePoint. Now, you want to ...


6

The easiest way to invoke some code on submission (...insert) of a list item it to write an ItemAdded event receiver. The item level event receiver can be registered against a web, list or content type. Here's an example of registering one against a web (...this would fire for an item added to any list or library on the web: SPEventReceiverDefinition ...


6

Codeplex - SharePoint Filtered Lookup Field This project creates a custom SharePoint lookup field that offers new functionalities to default SharePoint lookup field by allowing filters to be applied to retrieved data. Applied filters can be either dynamic CAML queries or pre-defined list views residing in source lists ...


6

Looks like you're using default Update method of SPContentType when updating your content type in feature updating receiver. To push changes to all inherited list content types, you should use another overload of the Update method, and pass true to it: contentType.Update(true); Description of the parameter from MSDN: updateChildren Type: ...


6

Here's an example of a content slider for SharePoint I made based on jQuery, https://www.nothingbutsharepoint.com/sites/eusp/pages/creating-your-own-content-slider-for-sharepoint.aspx.


6

I hate answering my owner questions here but found the problem. There's a flag on lists you can set a list to AllowDelete or not (this is for lists that are critical to the operation of a feature). The flag on these lists were set to False and wouldn't allow deletion. It still doesn't explain why the list was showing up twice both in the UI and SharePoint ...



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