1
vote
2answers
34 views

Enable versioning on SPList programmatically

I might be missing something obvious, but I am trying to enable version history on a regular task list programmatically. It is definitely possible from the UI, but how can this be achieved in code? I ...
1
vote
1answer
41 views

How to embed SPList to a custom application page?

I have a custom central admin list and would like to insert it to a custom application page in a way that would make it look exactly like it does if you access the list via its URL - i.e. it should ...
1
vote
0answers
88 views

How do I make a dynamically created SPList read-only in browser, but editable in code?

In code, I create a SPList. I write to this list programatically, but I would like the list to appear read-only for all users (perhaps excluding admins only) in browser only, i.e. I don't want to ...
1
vote
2answers
194 views

Why does SPList.GetItems(string fields[]) return more fields than specified?

I'm using SPList.GetItems(string fields[]) to obtain only specific item fields from a document library: SPListItemCollection items = list.GetItems("UniqueId", "Name"); However, iterating the items ...
1
vote
1answer
30 views

Is there a setting that determines the default root folder of a freshly-created SPList?

I noticed that when I create lists on my development site(s), they're created right in the site's root (in other words, URLs look like xxx/sites/DEV/DocLibX). The last time I looked (a few days ago), ...
1
vote
0answers
69 views

Using DefaultNewFormUrl's link on Document Library opens item on save

As our company tries to move away from the folder structure and into a tag-driven structure we were left with a dilemma. Users can only add content to folders/libraries yet they don't want to have to ...
1
vote
2answers
237 views

Deleting all items from a list and then adding new items will not give the new items id 1,2,3 etc

I have a list with 3 items. When I delete these 3 items and add new items they get ID 4, ID 5 and ID 6. But I want the new items to get ID 1, ID 2, and ID 3. Is there any workaround? This is how I ...
0
votes
2answers
230 views

add SPListItem with more than one field of data

I want to add an item to a SharePoint task list, with data in the Title, AssignedTo, and Status columns. The code below adds the item with data in the Title column, but no data in the other columns. ...
0
votes
4answers
413 views

Safely return all lists in site collection that match criteria

I'm using the following code to get all "Announcement" lists in a Web Applications site collection. Unfortunately, sometimes the current user does not have permission to that site and the page fails ...
1
vote
2answers
163 views

Dynamically assemble CAML to call related List Items?

I have good methods in place to get my core List of Posts. Let's say I get the 100 most recent Posts. I'd like to get all comments related to those posts. Comments have a field called PostID that ...
1
vote
0answers
42 views

Is my Data Access model acceptable?

I'm creating a SharePoint application and want to do things the right way as often as possible. I'm deploying a series of Lists in a Site Definition, and I want to lock down Data Access to a series ...
0
votes
1answer
613 views

Proper use of SPWeb from SPContext for pulling lists

So, after about two hours on the subject I am thoroughly confused. There are viewpoints all over the place on how, when, and why to use Dispose() on SPWeb objects as they relate to SPContext. Can ...
2
votes
1answer
400 views

get hold of a list

$web gives me the title of the website $list is not giving me any and therefore item add/update i m doing is failing. What is wrong? The code works in dev area. btw, I am running with full rights on ...
1
vote
1answer
991 views

When to use List<SPList> vs SPListCollection?

If I have to grab numerous lists which I have the name, URL or Guid of, should I use web.Lists and return the entire SPListCollection or grab the specific ones I need via web.Lists[Guid] and place ...
3
votes
5answers
4k views

How do you hide a hidden list?

If you set the SPList.Hidden property to true, the list isn't shown in the Quick Launch, All Site Content, Lookup lists, etc. However, it is still possible to navigate to the list by typing in the ...