.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Distinct List View over multiple columns

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :SharePoint

I have a custom list with People, Courses, and Completion Dates. People take multiple courses, and sometimes they also take a course again to refresh. I would like to show the list with all people and all courses, but if a person has taken the same course multiple times, I only want to show the last time the course was taken. In SQL this would be some sort of a DISTINCT query over the combination of PERSON and COURSE. Has anyone done something like this with SP lists (without code ;-) ).

A workaround would be to flag expired courses, once the person has taken the course again. This way you could filter for the not-expired records, but maybe there is a better way. Suggestions?




View Complete Post

More Related Resource Links

Can Managed Metadata columns be edited in the DataSheet View of a Library or List?

Hi, I like to mass set document properties in a library using DataSheet View, the properties are columns based on Managed MetaData values. When I open the doc library in Datasheet view, those columns become read-only. I made sure the library does not require 'Check Out' and also tested it in other views then the AllItems view. Can someone confirm what is the expected functionality and or if there is a bug?

Can Managed Metadata columns be edited in the DataSheet View of a Library or List?

Hi, I like to mass set document properties in a library using DataSheet View, the properties are columns based on Managed MetaData values. When I open the doc library in Datasheet view, those columns are read-only. I made sure the library does not require 'Check Out' and also tested it in other views then the AllItems view. Can someone confirm what is the expected functionality and or if there is a bug? Should I be able to edit them in 2010 and were they editable in 2007 version. Please help. thanks. I came across this other post which suggests that functionality is not available ? pls someone confirm. Mass-editing metadata when documents are uploaded (individually or in bulk) to MOSS 2010  

Read only view to certain columns in a list

Hi, I am using SP 2010 and needed help in customizing an exisiting list. I need to make 3 columns of the list editable to 3 users only and the rest of the users have a READ-ONLY option. How can this be done?

How to filter a List View by multiple values for one filter field?

Hi, I need to create a dynamically created link to a List View with a filter on one field, but with multiple values. Example: http://<server>/Lists/<list>/Allitems.aspx?FilterField1=Name&FilterValue1=John/Jack/Jonas which should give me all items where Name equals John, Jack or Jonas. Is this even possible?

Multiple selection in connected list view webpart

Hi all, I have a webpart page with 2 listview webparts connected via  ("Send Row of Data"/"Get filter values from"). This connection permits me to select one row on the first listview (parent) and the second (child) gets filtered by the defined filter column. My question is how can I choose multiple rows on the parent so I can filter the rows of the child with multiple filter values? It seems on can only select one row via the "Select" column... Is there a workaround... Many thanks,  

how to display multiple calendar list data in single calendar view

Hi, Normally, we can used to extend the ListViewWebPart's ViewType property to display a particular calendar list items in Calendar View in our custom webpart. Is it any way to display multiple calendar list data in a single calendar view ?? or please provide some pointers related to this issue. Any help is much appreciated.    

Using a List View web part to display documents from multiple document libraries from different site

Hi there, I am trying to have one web part display documents (or list items) from different document libraries (or different lists) from different site collections. I have achieved this under a single site collection using Data View Web Part (using SPD). I have also achieved displaying a single document library (or a list) from a different site collection by using List View Web Part. but I am not sure how to get my head around displaying documents or list items from different document libraries or lists across site collections. I have thought of using SPSiteDataQuery or ListViewByQuery, but they all seem to focus one site collection at a time. If any of you have done this before, please share your best practice on this one with me. Much appreciated. Clark

Multiple "Name" and "Title" columns when I create a view progammatically


I am trying to progammatically create some datasheet views to make it easy for my users to have grids to edit bulks of documents at once.  Everything seemed to work fine at first but then I discovered that when I switched from a Datasheet View to a Standard View, I noticed that the "Name" and "Title" columns repeat themselves.  Upon further investigation, I discovered that it actually added another "Name" and "Title" column to my document library. 

I think this may be due to the "Show with edit menu" values but after trying to filter out columns where AuthoringInfo == null, I still get the same problem.

Does anyone have a solution for this? 

My code is below: 

if (contenttype.Name !=

List View Fields/Columns read only


i programmtically add a view to a SP List. Within this view I want to make some columns read only to certain group of users. How should I implement this?

Here is my code for creating an view programmatically:
public partial class _Default : System.Web.UI.Page 


    protected void Page_Load(object sender, EventArgs e)


        SPSite mySite = new SPSite("http://spserv");

        //SPWeb myWeb = mySite.OpenWeb("/vst");

        using (SPWeb oWebsite = mySite.AllWebs["website_name"])


            oWebsite.AllowUnsafeUpdates = true;

            SPList oList = oWebsite.Lists["list_name"];

            SPViewCollection collViews = oList.Views;

            string strViewName = "CustomView";


Drop Down menu connected to Sharepoint list with multiple columns




I have a sharepoint list with 2 columns (employee name and employee phone #).  Is there any way to have a drop down list with the employee name and then right next to it have a text box show the employee telephone number?  i.e. if I choose my name from the drop down list, my phone number will show up right next to my name.  Thanks!



Designing a view for Share Point list with vertically repeated columns


I want to create a view for a Share Point List, which displays employee name and his/her phone number. I need to design this view in such a way that all items fit on one page and as there are more items they need to be displayed in repeated columns, instead of displaying on next page. Is it possible to achieve this without programming and just using Share Point Designer? I tried the conditional formatting but did not know how to achieve the repeated columns?

Anyone done this functionality or can provide any insight?



Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

Filter search over multiple text columns


Hi everyone,

I'm working on a library that stores information on various cases. The case table has several columns that contain descriptive strings on what happened in the case. I would like to create a single filter that returns all cases where the search string is found in any of the columns. I've looked at Dynamic Data Filtering, but as far as I can tell, the "Contains" filter only allows you to connect to each column individually. Has anyone tried this?



Entity Data Model and database view returning the same columns as there are in a table


When adding a stored procedure into the Entity Data Model I can select whether the procedure returns a scalar, a (new) complex type or one of the entity types I already defined. 

How do I do something similar for a view?

I mean assuming I have a view like this

CREATE VIEW FilteredFoos as SELECT Foo.* FROM Foo join ... WHERE ...

(that is a view that implements some involved filtering, but returns all columns from one table) how do I add it to the project so that I can use the entity set, but get the Foo objects, not some new FilteredFoo objects.

var foos = myDB.FilteredFoos.Include("Bar").ToList();

foreach (Foo foo in foos) { ...

Thanks, Jenda

Required columns on list; how can I reset them to be NOT required?

I have a user list where several fields in a sharepoint list that were originally created as required, but would now like to make them not required. I have already tried simply unchecking the required field checkbox, but that does not work. Any other ways to do this?
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend