none
Programmatically hide items in list RRS feed

  • Question

  • Is it possible to programmatically hide items in a sharepoint list?

    I dont want to delete the item, but just want to control which items are to be displayed.

    Monday, March 5, 2012 1:14 PM

Answers

  • Use the permissions to hide items from other people. If you only use a column to filter, the people will find the items over the search.

    You can use the SPEventReceiver of ItemUpdated or ItemAdded and a column (criteria to hide) to automate the change of permissions.

    br,
    ronald


    • Edited by Ronald Baldauf Monday, March 5, 2012 2:48 PM update
    • Proposed as answer by Ronald Baldauf Monday, March 5, 2012 2:48 PM
    • Unproposed as answer by Ronald Baldauf Monday, March 5, 2012 3:15 PM
    • Marked as answer by dutatran Tuesday, March 6, 2012 9:13 AM
    Monday, March 5, 2012 2:46 PM

All replies

  • a simple way to do it would be to add a hidden yes/no field on a list. then use a view with a filter. you could access the list programtically and set the yes/no to "yes" (hidden) and then let the view do its thing.

    if you wanted it to be a global feature and not just to a particular list, you might be able to do something clever with CSS and a ribbon command. in a basic list view, the row element has a distinct class name and identifier.

    neither of these approaches implies anything around security, however. I am sure there are a lot of other ways to tackle this issue.

    Monday, March 5, 2012 1:23 PM
  • Thx. that was a simple way of doing it. ill try it out.

    Monday, March 5, 2012 1:25 PM
  • Use the permissions to hide items from other people. If you only use a column to filter, the people will find the items over the search.

    You can use the SPEventReceiver of ItemUpdated or ItemAdded and a column (criteria to hide) to automate the change of permissions.

    br,
    ronald


    • Edited by Ronald Baldauf Monday, March 5, 2012 2:48 PM update
    • Proposed as answer by Ronald Baldauf Monday, March 5, 2012 2:48 PM
    • Unproposed as answer by Ronald Baldauf Monday, March 5, 2012 3:15 PM
    • Marked as answer by dutatran Tuesday, March 6, 2012 9:13 AM
    Monday, March 5, 2012 2:46 PM