Answered Custom list view

  • martedì 21 agosto 2012 20:11
     
     

    Hello everyone!

    I have a list where a column is of type User/Group but only groups are inserted.

    I need to create a view where i see only the items that im on the group assigned.

    I managed to do this with a custom code... but the SPGridView looks like sharepoint 2007 and that totally "reveals the magic"...

    can anyone help? either tell me how to fix the look and feel of SPGridView or another way to create the view?!?

Tutte le risposte

  • martedì 21 agosto 2012 21:08
     
     

    Hi Leonardo,

    If you are using the task list, then you need not to re invent the wheel. There is a default view called "By My Groups" which shows the items assigned to the group where you are a member of.

    If you are using custom list and trying to achieve the above, then you can create the custom view based on this "By My Groups" using a SharePoint designer by copying the xslt of the view.

    hope this helps.

    thanks

    Diya

    ------------------------------------------------------------------------------------------------------------

    Please mark as answer if this answers your query and vote if this is helpful to you

  • mercoledì 22 agosto 2012 15:55
     
     

    Thank you but it did not worked... Apparently "By My Groups" relates to the "Assigned To" field... my list did maintained the Assigned To field, but i have a new field that is Assigned Department, of the type user/group...

    The ideia is that the system will assign a task to a department (wich is a group). In my custom view (named "My Department New Tasks" or "My Department Unassigned Tasks"), the dept employes will be able to see only the items that are not assigned to someone (once a task is assigned to a person, its no longer "new") BUT are assigned to a department wich he is a part of... heres a basic ilustration:


  • mercoledì 22 agosto 2012 17:14
     
     Con risposta

    Hi,

    The link below has the solution.

    http://spuser.wordpress.com/2012/01/13/filtering-list-items-in-sharepoint-based-on-current-user-and-current-user-groups/

    Let me know if it solves your problem.


    -Kranthi

  • mercoledì 22 agosto 2012 19:52
     
     Con risposta Contiene codice

    Leonardo,

    Create a view from SharePoint site on the list. i.e. based on "By My Groups".

    Go to the designer and modify the CAML of the XSLT of the view created by changing the where clause similar to you see in the view "By My Groups"

    <Where>
    	<Membership Type="CurrentUserGroups">
    		<FieldRef Name="Assigned_x0020_Dept"/>
    	</Membership>
    </Where>
     

    here my custom column is "Assigned Dept" .  Save the changes and you should be able to see the tasks assigned to the groups(custom column). Modify the filter in view to include the tasks which are not assigned to with "OR" condition in addition to the above.

    thanks

    Diya

    --------------------------------------------------------------------------------------------

    Please mark as answer if this answers your query and vote if this is helpful to you



    • Modificato diyach mercoledì 22 agosto 2012 19:52
    • Modificato diyach mercoledì 22 agosto 2012 19:53
    • Contrassegnato come risposta Leonardo A L Ferreira giovedì 23 agosto 2012 14:39
    •