Inline Editing in SharePoint 2010 (UI and Code)

Within SharePoint 2010 it is possible to enable inline editing on list items. This can be done by changing properties on a view of a SharePoint library what can be done in code and trough the user interface. To allow inline editing trough the user interface you have to do the following: Navigate to the list for which you want to allow inline editing:

ListSettings

Click on list and then list settings. On the list settings screen click on the list view you would like to edit on the bottom of the screen:

ListSettingsScreen

In the view screen you have a section called: Inline editing. Within that section you have a checkbox to allow inline editing:

ViewSettings

When you have enabled this checkbox you can inline edit the items in your list:

InlineEditing

Inline editing can also be enabled trough code. You can do this by following the code example below:

using(SPSite site = new SPSite("URL of the site"))
{
    SPWeb web = site.RootWeb;
    SPList list = web.Lists["Name of the list"];

    SPView view  = list.Views["Title of the view"];
    view.InlineEdit = "TRUE";
    view.Update();
}

The ‘InlineEdit’ property on the view is in the public beta version of SharePoint 2010 a string value. Hopefully they will change this to a Boolean value in the final version.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.